dataSourceとの両方として機能する単一のビュー コントローラーがdelegateありUICollectionViewます。
- (UICollectionViewCell *)collectionView:(UICollectionView *)cv cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    PhotoCell *cell = [cv dequeueReusableCellWithReuseIdentifier:@"PIC_CELL" forIndexPath:indexPath];
    UIImage *photo = [UIImage imageWithData:[[_fetchedImages objectAtIndex:indexPath.row] valueForKey:@"picture"]];
    if (photo) {
        cell.photo = photo;
    }
    return cell;
}
photo上記の方法では、カスタム コレクション ビュー セルをインスタンス化し、そのプロパティを設定しようとしています。
PhotoCell.h
@interface PhotoCell : UICollectionViewCell {
}
@property (nonatomic, strong) IBOutlet UIImageView *imageView;
@property (nonatomic, strong) UIImage *photo;
@end
PhotoCell.m
@implementation PhotoCell
- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        //customization
    }
    return self;
}
- (void)setPhoto:(UIImage *)photo {
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(83.0, 83.0), NO, 0.0);
    [photo drawInRect:CGRectMake(0, 0, 83, 83)];
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    if (_photo != newImage)
        _photo = newImage;
    self.imageView.image = _photo;
}
photoここでは、プロパティのセッターをオーバーライドして、渡された写真をプロパティとして設定する前にサイズを変更できるようにします。
ただし、コードが実行され、カスタム セルがインスタンス化されると、メソッドでプロパティPhotoCellを設定しようとすると、次のエラーがスローされます。photo-cellForItemAtIndexPath:
    -[UICollectionViewCell setPhoto:]: unrecognized selector sent to instance 0x155c1270
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICollectionViewCell setPhoto:]: unrecognized selector sent to instance 0x155c1270'
システムは、カスタム セルをUICollectionViewCell、実際のクラス ではなく、そのスーパークラス のインスタンスとして認識しているようPhotoCellです。セッターをオーバーライドしないと、同じエラーがスローされます。
カスタマイズされたセルがそのスーパークラスのインスタンスと見なされ、セッターが認識されないのはなぜですか?