Search code examples
ios6selectoruicollectionviewcell

[UICollectionViewCell imageCell]: unrecognized selector sent to instance


I read ALL questions with this tittle. FavoritosViewController.m I have:

- (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;
}

on favcolCell.h I have:

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

on favcolCell.m I have:

    @synthesize imageCell;

(...)

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

What I'm missing?

EDIT:

Solution: Do the right class registration.


Solution

  • I missed this:

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

    on the ViewDidLoad Method. I registered the wrong class. Thanks to user HotLicks.