Ios 无法使用属性控制UICollectionView

Ios 无法使用属性控制UICollectionView,ios,uicollectionview,Ios,Uicollectionview,因此,我有一个UICollectionView对象的属性 @property (strong, nonatomic) IBOutlet UICollectionView *collectionViewVARIABLE; 我握着控制键,拖动鼠标,一切都连接起来了 我的问题是它实际上似乎不起作用 我试着打电话 [self.collectionViewVARIABLE registerClass:[MFH_mainfeed_CondensedViewCell class] forCellWith

因此,我有一个UICollectionView对象的属性

@property (strong, nonatomic) IBOutlet UICollectionView *collectionViewVARIABLE;
我握着控制键,拖动鼠标,一切都连接起来了

我的问题是它实际上似乎不起作用

我试着打电话

[self.collectionViewVARIABLE registerClass:[MFH_mainfeed_CondensedViewCell class]   forCellWithReuseIdentifier:@"MainIpadFeedCell"];
我得到这个错误:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier MainIpadFeedCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
如果我使用collectionView而不是变量将此调用放在cellForItemAtIndexPath中,它就会工作

我试过按一下按钮,也没试过

self.collectionViewVARIABLE.backgroundColor = [UIColor blackColor];

我已经干了三天了。我头痛。有人能告诉我我遗漏了什么吗。

发布您的实际错误消息。另外,记录self.collectionViewVARIABLE并查看它给出了什么。***,/SourceCache/UIKit_Sim/UIKit-2380.17/UICollectionView.m:2249以及self.collectionViewVARIABLE的日志显示了什么?非常确定,当我添加对属性的引用时,它不会将其添加到UICollectionView对象***由于未捕获的异常“nsinternalinconsistenception”而终止应用程序,原因:“无法将标识符为MainIpadFeedCell的UICollectionElementKindCell类型的视图出列-必须为标识符注册nib或类,或连接情节提要中的原型单元格”