我遇到了以下崩溃:
由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法使类型的视图出列:具有标识符的UICollectionElementKindCellCell - 必须为标识符注册nib或类或在故事板中连接原型单元'
我在ViewDidLoad中有以下内容:
[self.collectionView registerClass:[UICollectionViewCell class]
forCellWithReuseIdentifier:@"Cell"];
Run Code Online (Sandbox Code Playgroud)
崩溃的行在cellForItemAtIndexPath回调中:
UICollectionViewCell *cell = [collectionView
dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
Run Code Online (Sandbox Code Playgroud)
我一直在寻找几个小时,但找不到任何解决方案.我已经尝试了子类化UICollectionViewCell,但得到了同样的错误.
使用断点,我确定在执行dequeueReusableCellWithReuseIdentifier回调之前正在执行registerClass行.
我收到以下崩溃日志,显示我的应用程序具有"超出允许时间的活动断言".我的应用是一个音频流应用程序.仅当应用程序在后台并且不流式传输任何音频内容时才会发生崩溃.
笔记:
有关如何跟踪此问题的任何建议吗?
这是崩溃日志(没有二进制映像):
Incident Identifier: 0467A340-1FD2-4D49-9FA4-76360889976D
CrashReporter Key: fdae46f133d13bdc3f043301bc008bd56155588d
Hardware Model: iPhone3,1
Process: MyApp [249]
Path: /var/mobile/Applications/DAA6B446-07D3-4C7C-BD44-80920338CAF4/MyApp/MyApp
Identifier: MyApp
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2011-11-17 15:25:59.960 -0500
OS Version: iPhone OS 5.0.1 (9A405)
Report Version: 104
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 4
Application Specific Information:
MyApp[249] has active assertions beyond permitted time:
{(
<SBProcessAssertion: 0xfed8890> identifier: UIKitBackgroundCompletionTask process: MyApp[249] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:249 …Run Code Online (Sandbox Code Playgroud)