在故事板中创建IBOutlet的问题

时间:2012-11-28 10:54:14

标签: iphone objective-c ios xcode ipad

我创建了一个UICollectionViewController自定义类,我在单元格中插入了一个UIImageView,然后创建了一个IBOutlet:

@property (weak , nonatomic) IBOutlet UIImageView *imageCell;

enter image description here

但是当我编译项目时,调试器给了我这个错误:

enter image description here

谢谢。

2 个答案:

答案 0 :(得分:1)

您需要创建一个自定义类 - UIImageView的子类。像MyCustomImageView这样的东西,并把它设置到插座的类。还有一件事 - 你最好用strong修饰符创建一个出口。另请查看评论中提供的链接more information on your question

答案 1 :(得分:0)