【发布时间】:2014-01-12 16:24:16
【问题描述】:
我正在学习使用 Collection View Controller 的教程,但我被困在最后一点。
-(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编程的新手,所以请考虑一下
谢谢
【问题讨论】:
-
ImageView在您的属性声明中应为imageView(小写“i”) -
谢谢,它解决了这个问题:)
-
你应该把它作为答案
标签: ios collectionview