深入了解崩溃

时间:2012-02-09 11:09:55

标签: iphone debugging

我遇到了以下崩溃,我无法按需复制但确实发生了足以引起用户注意的事件。

此崩溃报告也已被象征化。你怎么知道原因!!!这似乎只发生在4.1

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x9f069184
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                     0x000027d8 objc_msgSend + 16
1   CoreFoundation                      0x0007d749 ____CFXNotificationPost_old_block_invoke_1 + 45
2   libSystem.B.dylib                   0x000d5984 _dispatch_call_block_and_release + 20
3   libSystem.B.dylib                   0x000d66b0 _dispatch_continuation_pop + 72
4   libSystem.B.dylib                   0x000d69fc _dispatch_main_queue_callback_4CF + 220
5   CoreFoundation                      0x0002789b __CFRunLoopRun + 1335
6   CoreFoundation                      0x00027277 CFRunLoopRunSpecific + 231
7   CoreFoundation                      0x0002717f CFRunLoopRunInMode + 59
8   GraphicsServices                    0x000045f3 GSEventRunModal + 115
9   GraphicsServices                    0x0000469f GSEventRun + 63
10  UIKit                               0x00004123 -[UIApplication _run] + 403
11  UIKit                               0x0000212f UIApplicationMain + 671
12  MyApp                               0x000024e3 main (main.m:17)

我已经设法获得更多信息,但并不多。

2012-02-12 18:03:04.556 MyApp[462:307] (null): unrecognized selector sent to class 0x3e0a360c
2012-02-12 18:03:04.618 MyApp[462:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '(null): unrecognized selector sent to class 0x3e0a360c'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x33506ed3 __exceptionPreprocess + 114
    1   libobjc.A.dylib                     0x30412811 objc_exception_throw + 24
    2   CoreFoundation                      0x335086ff +[NSObject(NSObject) doesNotRecognizeSelector:] + 102
    3   CoreFoundation                      0x334b01d9 ___forwarding___ + 508
    4   CoreFoundation                      0x334aff90 _CF_forwarding_prep_0 + 48
    5   Foundation                          0x302a86b3 _nsnote_callback + 142
    6   CoreFoundation                      0x334e4749 ____CFXNotificationPost_old_block_invoke_1 + 44
    7   libSystem.B.dylib                   0x31d05984 _dispatch_call_block_and_release + 20
    8   libSystem.B.dylib                   0x31d066b0 _dispatch_continuation_pop + 72
    9   libSystem.B.dylib                   0x31d069fc _dispatch_main_queue_callback_4CF + 220
    10  CoreFoundation                      0x3348e89b __CFRunLoopRun + 1334
    11  CoreFoundation                      0x3348e277 CFRunLoopRunSpecific + 230
    12  CoreFoundation                      0x3348e17f CFRunLoopRunInMode + 58
    13  GraphicsServices                    0x31b5e5f3 GSEventRunModal + 114
    14  GraphicsServices                    0x31b5e69f GSEventRun + 62
    15  UIKit                               0x341bd123 -[UIApplication _run] + 402
    16  UIKit                               0x341bb12f UIApplicationMain + 670

现在我的所有addObservers都是基于块的,因此我无法理解为什么它会导致无法识别的选择器。

1 个答案:

答案 0 :(得分:2)

这种方式在调试崩溃时对我们没什么帮助。我找到了调试Crash代码的最佳方法之一。请点击调试技术链接:

https://cocoadev.com/DebuggingAutorelease.html

您需要非常仔细地分析您的控制台,以查看崩溃发生的实际原因。这对几乎所有未启用ARC的代码都有帮助。