调试iOS异常的好方法

时间:2013-03-20 09:08:55

标签: iphone ios

我想在我的应用程序中调试我的异常,我已阅读

Debugging -[NSCFDictionary setObject:forKey:]: attempt to insert nil value添加,但这些方法是在我运行我的应用程序时发生的,所以我可以使用添加异常断点,单击断点列表底部的添加(+)按钮,然后单击添加异常断点,并使用gcc命令行。但我的问题是,如果用户给我一个崩溃报告,这个错误不容易发生,如何解决它,例如:

  Application received signal SIGSEGV
  (null)
 (
0   CoreFoundation                      0x3120e2bb  + 186
1   libobjc.A.dylib                     0x38f2b97f objc_exception_throw + 30
2   CoreFoundation                      0x3120e1c5  + 0
3   myshine                             0x001f9f51 myshine + 1503057
4   libsystem_c.dylib                   0x393a9e8b _sigtramp + 34
5   myshine                             0x000ac985 myshine + 137605
6   myshine                             0x000ac35d myshine + 136029
7   CoreFoundation                      0x311ab7cf  + 74
8   CoreFoundation                      0x311b1623  + 74
9   CoreFoundation                      0x311ab507  + 326
10  CFNetwork                           0x30f0fa8b  + 98
11  CFNetwork                           0x30f0ec71  + 36
12  CFNetwork                           0x30f11365  + 44
13  CFNetwork                           0x30f110f9  + 88
14  CFNetwork                           0x30f114ff  + 34
15  CFNetwork                           0x30ed0ce1  + 324
16  CFNetwork                           0x30ed1661  + 156
17  CFNetwork                           0x30f0ec71  + 36
18  CFNetwork                           0x30f11365  + 44
19  CoreFoundation                      0x311e3683  + 14
20  CoreFoundation                      0x311e2ee9  + 212
21  CoreFoundation                      0x311e1cb7  + 646
22  CoreFoundation                      0x31154ebd CFRunLoopRunSpecific + 356
23  CoreFoundation                      0x311b39bb CFRunLoopRun + 98
24  myshine                             0x000b20ef myshine + 159983
25  Foundation                          0x31b24e85  + 972
26  libsystem_c.dylib                   0x39382311  + 308
27  libsystem_c.dylib                   0x393821d8 thread_start + 8

*** -[__NSArrayM objectAtIndex:]: index 121 beyond bounds [0 .. 23]

 (
0   CoreFoundation                      0x311963ff  + 186
1   libobjc.A.dylib                     0x38e87963 objc_exception_throw + 30
2   CoreFoundation                      0x310e1ef9  + 164
3   myshine                             0x001720b1 myshine + 1372337
4   UIKit                               0x33090087  + 70
5   UIKit                               0x3309003b  + 30
6   UIKit                               0x33090015  + 44
7   UIKit                               0x3308f8cb  + 502
8   UIKit                               0x3308fdb9  + 488
9   UIKit                               0x32fb85f9  + 524
10  UIKit                               0x32fa58e1  + 380
11  UIKit                               0x32fa51ef  + 6198
12  GraphicsServices                    0x34cbc5f7  + 590
13  GraphicsServices                    0x34cbc227  + 34
14  CoreFoundation                      0x3116b3e7  + 34
15  CoreFoundation                      0x3116b38b  + 138
16  CoreFoundation                      0x3116a20f  + 1382
17  CoreFoundation                      0x310dd23d CFRunLoopRunSpecific + 356
18  CoreFoundation                      0x310dd0c9 CFRunLoopRunInMode + 104
19  GraphicsServices                    0x34cbb33b GSEventRunModal + 74
20  UIKit                               0x32ff92b9 UIApplicationMain + 1120
21  myshine                             0x00026ec7 myshine + 16071
22  myshine                             0x00025660 myshine + 9824
 )

通过我知道NSArray超出界限,但我的应用程序有很多NSArray,他们是用户报告,你能给我一些简单的方法来找到位置吗?

1 个答案:

答案 0 :(得分:1)

根据您的问题我理解的是您想要的应用程序中出现崩溃的方法。可能这可以帮助你Symbolicating iPhone App Crash Reports