2014-01-12 39 views
1

我正在使用集合視圖控制器的教程,我卡在最後一點。集合視圖控制器沒有getter方法從屬性讀取

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

上線myCell.imageView.image = image;我收到錯誤 「讀不getter方法從屬性」

這裏是MainMenuItemViewCell.h

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

我相信這是一些愚蠢的事。我在iOS的編程新手,所以請把它考慮

THX

+0

'ImageView'應該是'imageView'(小寫'我')在您的財產聲明 – jonahb

+0

thx,它修正了:) – maximilliano

+0

你應該把這作爲一個答案 – maximilliano

回答

3

ImageView應該是imageView(小寫的「i」)在你的財產申報。

相關問題