UICollectionView
とのコラボレーションでUICollectionViewCell
画像のサムネイルを表示しようとしています。私のUICollectionViewCell
アプリで使用されているは、カスタム(単純な)サブクラスです。
#import "MemeCell.h"
@implementation MemeCell
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
}
return self;
}
-(void)setThumb:(UIImage *)image {
if (_thumb != image) {
_thumb = image;
}
_imageThumb.image = _thumb;
}
@end
そして、File's Owner
私のUICollectionView
中で、私は使用します:
- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath {
static BOOL nibLoaded = NO;
if (!nibLoaded) {
UINib *cellNib = [UINib nibWithNibName:@"MemeCell" bundle:nil];
[_collectionView registerNib:cellNib forCellWithReuseIdentifier:@"MemeCell"];
nibLoaded = YES;
}
MemeCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"MemeCell" forIndexPath:indexPath];
NSString *path = [_imageThumbs objectAtIndex:indexPath.section];
UIImage *thumb = [UIImage imageNamed:path];
[cell setThumb:thumb];
return cell;
}
セルを返します。ビューは最初に表示されたときは正常に機能しますが、デリゲート呼び出しから自分自身を却下した後は、[self dismissViewControllerAnimated:YES completion:nil]
クラッシュせずに再度表示することはできません。
2013-03-10 22:11:35.448 CapifyPro[21115:907] -[UICollectionViewCell setThumb:]: unrecognized selector sent to instance 0x1e593320
2013-03-10 22:11:35.450 CapifyPro[21115:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionViewCell setThumb:]: unrecognized selector sent to instance 0x1e593320'
誰かが洞察を提供できますか?