小编Ken*_*Ken的帖子

dequeueReusableCellWithReuseIdentifier崩溃'无法将类视图出列"UICollectionElementKindCell"

我遇到了以下崩溃:

由于未捕获的异常'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行.

collections xcode deque

13
推荐指数
1
解决办法
3万
查看次数

无法找到导致"超出允许时间的主动断言"崩溃的错误

我收到以下崩溃日志,显示我的应用程序具有"超出允许时间的活动断言".我的应用是一个音频流应用程序.仅当应用程序在后台并且不流式传输任何音频内容时才会发生崩溃.

笔记:

  • 我确保applicationDidEnterBackground中的beginBackgroundTaskWithExpirationHandler在applicationWillEnterForeground中具有相应的endBackgroundTask.
  • 所有网络访问都在自己的线程上,而不是在主线程上.
  • 当应用程序在后台时,任何线程都不会尝试访问网络.
  • 该错误是随机的,无法通过将设备切换到飞行模式或关闭WiFi来复制.

有关如何跟踪此问题的任何建议吗?

这是崩溃日志(没有二进制映像):

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)

iphone crash assertions ios

6
推荐指数
1
解决办法
2081
查看次数

标签 统计

assertions ×1

collections ×1

crash ×1

deque ×1

ios ×1

iphone ×1

xcode ×1