2014-01-12 42 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”)在你的财产申报。

相关问题