ios - os, objective-c, 我无法准确知道我的应用程序崩溃的那一行

标签 ios objective-c iphone

我的应用程序崩溃,每次运行应用程序时,我都会随机遇到不同的崩溃,我想知道我的应用程序崩溃的确切行,所以我使用了僵尸对象和异常断点,但是 xcode (版本 6.3.1) 不显示有关导致崩溃的确切行的任何信息。

我随机遇到以下崩溃(一次崩溃一次,这些崩溃是随机发生的):

我在 ipad 上遇到以下崩溃问题。请注意,崩溃一次随机发生,遵循以下这些:

1) *** -[UIViewAnimationState release]: message sent to deallocated instance 0x7fb78bb6eb50

2) [UICollectionViewLayoutAttributes release]: message sent to deallocated instance 0x18911af0 –

3) *** -[_UIFlowLayoutItem respondsToSelector:]: message sent to deallocated instance 0x7e7ca1d0

4) FlrtAlertVariation[39992:1010801] negative or zero sizes are not supported in the flow layout

5) [_UIFlowLayoutItem setItemFrame:]: message sent to deallocated instance 0x7fcc35296310

6) * Terminating app due to uncaught exception 'NSRangeException', >reason: '* -[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4]'

7)FlrtAlertVariation[227:60b] Gesture: Failed to receive system gesture state notification before next touch

8) *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BestMatchRequester everyBodyResponseData:]: unrecognized selector sent to instance 0x14662aa0'

9)* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView recieved layout attributes for a cell with an index path that does not exist: {length = 2, path = 1 - 0}' * First throw call stack: (0x2f780fd3 0x3a31fccf 0x2f780ead 0x3012dd5b 0x31ff8fa3 0x31ff85c7 0x31ff805d 0x31f9cd79 0x31c1a62b 0x31c15e3b 0x31c15ccd 0x31c156df 0x31c154ef 0x31c0f21d 0x2f74c2a5 0x2f749c49 0x2f749f8b 0x2f6b4f4f 0x2f6b4d33 0x345da663 0x3200016d 0x2a2bd9 0x3a82cab7) libc++abi.dylib: terminating with uncaught exception of type NSException

10) * error for object 0x156f8ea0: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug

11) *** Assertion failure in -[UICollectionViewData validateLayoutInRect:], /SourceCache/UIKit/UIKit-2935.137/UICollectionViewData.m:357

12)*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView recieved layout attributes for a cell with an index path that does not exist: {length = 2, path = 1 - 0}'

提前致谢。

最佳答案

两种可能性是您的代码非常糟糕并且到处都是错误,或者更可能是您遇到了一些系统性问题。

我建议你首先在你的项目中开启所有合理的警告,并修复所有给出警告的问题。然后你应该使用静态分析器来修复静态分析器发现的所有问题。

如果事情仍然崩溃,那么很可能你在后台线程上做了一些本应发生在主线程上的事情。在后台线程上执行需要在主线程上执行的操作是导致各种随机崩溃的绝佳方法。在那种情况下,调试崩溃是没有意义的,因为崩溃点离你的错误点很远。

关于ios - os, objective-c, 我无法准确知道我的应用程序崩溃的那一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30324316/

相关文章:

ios - 在 UISheetPresentationController 中自定义较小的 Detents?

ios - iphone:这个错误是什么?

iphone - 我可以信任 DragonFireSDK 吗?

ios - 是否可以通过 IAP 中的介绍价格实现免费试用?(IOS)

ios - 在返回值之前等待网络调用完成

iphone - Xcode iPhone - 要求多个文本输入然后返回它们的类

iphone - int++ 递增 4

iphone - 应用程序设计 - iPhone 和 Cocoa 应用程序之间的区别?

iphone - 如何过滤以逗号分隔的键的 NSDictionary 数组

ios - 了解 SKStoreReviewController 何时被解雇