1

このタイトルですべての質問を読みました。FavoritosViewController.m 私が持っている:

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
favcolCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"fav" forIndexPath:indexPath];
[[cell imageCell]setImage:[UIImage imageNamed:[arrayimages objectAtIndex:indexPath.item]]];
return cell;
}

favcolCell.h で私は持っています:

@property (retain, nonatomic) IBOutlet UIImageView *imageCell;

favcolCell.m で私は持っています:

    @synthesize imageCell;

(...)

- (void)dealloc {
    [imageCell release];
    [super dealloc];
}

私は何が欠けていますか?

編集:

解決策: 適切なクラス登録を行います。

4

2 に答える 2

10

私はこれを逃した:

[self.collectionView registerClass:[FavoritosRestViewCell class] forCellWithReuseIdentifier:@"fav"];

ViewDidLoadメソッドについて。間違ったクラスを登録しました。ユーザー HotLicks に感謝します。

于 2013-03-10T16:03:27.687 に答える
0

私にとってこれは解決策です..

セル内で1つのコレクションビューとimageViewを取得しました。しかし、インターフェース(ストーリーボード)ファイルにタグを設定するのを忘れていました。

絵コンテ→コレクションビュー→画像ビュー→プロパティインスペクター→ここにタグを設定。

誰かの役に立てば幸いです。

于 2015-04-15T07:01:46.007 に答える