所以,我有一个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];
我已经在这三天了。我头疼。有人可以告诉我我错过了什么。