Uicollectionview 控制器问题 [英] Uicollectionview controller issue

查看:34
本文介绍了Uicollectionview 控制器问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序崩溃并给出以下错误消息由于未捕获的异常而终止应用

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.

推荐答案

尝试在以下位置设置断点:

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

我猜你的 loadView(你的意思是 viewDidLoad?)方法没有被调用,所以这个类永远不会注册到 collectionView.

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

这篇关于Uicollectionview 控制器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆