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
'ImageView'應該是'imageView'(小寫'我')在您的財產聲明 – jonahb
thx,它修正了:) – maximilliano
你應該把這作爲一個答案 – maximilliano