2013-03-20 12 views
2

我想在我的应用程序调试我例外,我读好的方法来调试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

从你的问题我的理解是你想要的已经产生了您的应用程序崩溃的方法。可能是这可以帮助你Symbolicating iPhone App Crash Reports

+0

你的答案是我需要的,但我还有一个问题,如何编写代码生成崩溃报告http://www.raywenderlich.com/23704/demystifying-ios-application-crash-logs#,我的代码生成崩溃报告不就像设备生成一样,它是否也可以符号化iPhone应用崩溃报告? – pengwang 2013-03-20 10:04:56

+0

@pengwang有免费的解决方案,如https://www.crittercism.com,如果你想自动获得象征性的崩溃报告(不完全是你在〜/ Library/Logs/CrashReporter上的文件)。如果你想要更多的手动控制,可以尝试使用'NSSetUncaughtExceptionHandler'和'NSException'的'callStackSymbols'。 – 2013-03-20 11:18:47