Uicollectionview controller issue

2019-08-29 13:11发布

App crash and give following error message Terminating app due to uncaught exception

'NSInternalInconsistencyException', 
reason: '-[UICollectionViewController loadView]
 loaded the "RecipeCollectionViewController" nib but didn't get a UICollectionView.

1条回答
时光不老,我们不散
2楼-- · 2019-08-29 13:51

Try setting a breakpoint on:

[self.collectionView registerClass:[ImageCell class] forCellWithReuseIdentifier:@"MyCell"];

i would guess your loadView (did you mean viewDidLoad?) method is not being called, so the class is never registered with the collectionView.

查看更多
登录 后发表回答