Question

I was following a tutorial on using Collection View Controller and I am stuck on final bit.

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
                 cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    MainMenuItemViewCell *myCell = [collectionView
                                    dequeueReusableCellWithReuseIdentifier:@"MainMenuItemCell"
                                    forIndexPath:indexPath];

    UIImage *image;
    int row = [indexPath row];

    image = [UIImage imageNamed:_carImages[row]];

    myCell.imageView.image = image;

    return myCell;
}

on line myCell.imageView.image = image; I receive an error "no getter method for read from property"

Here is MainMenuItemViewCell.h

@interface MainMenuItemViewCell : UICollectionViewCell
@property (strong, nonatomic) IBOutlet UIImageView *ImageView;
@end

I am sure it is something stupid. I am a newbie in iOS programming so please take it into consideration

Thx

Was it helpful?

Solution

ImageView should be imageView (lowercase 'i') in your property declaration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top