【问题标题】:Collection View Controller no getter method for read from property集合视图控制器没有用于从属性读取的 getter 方法
【发布时间】: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


【解决方案1】:

ImageView 在您的属性声明中应为 imageView(小写“i”)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-06
    • 2014-03-02
    相关资源
    最近更新 更多