In iOS, what caused this crash?

不想你离开。 提交于 2019-12-08 00:58:06

问题


I got a crash in my iOS app, but their has only a few messages, some like this.

Application received signal SIGABRT
(null)
(
0   CoreFoundation                      0x359c68a7 __exceptionPreprocess + 186
1   libobjc.A.dylib                     0x37d6d259 objc_exception_throw + 32
2   CoreFoundation                      0x359c6789 +[NSException raise:format:] + 0
3   CoreFoundation                      0x359c67ab +[NSException raise:format:] + 34
4   myapp                               0x00241bf9 _ZNSt11_Deque_baseIsSaIsEE15_M_create_nodesEPPsS3_ + 1432772
5   libsystem_c.dylib                   0x32dd27e3 _sigtramp + 38
6   libsystem_c.dylib                   0x32dc820f pthread_kill + 54
7   libsystem_c.dylib                   0x32dc129f abort + 94
8   libc++abi.dylib                     0x35d7ef6b abort_message + 46
9   libc++abi.dylib                     0x35d7c3f1 _ZL19safe_handler_callerPFvvE + 120
10  libc++abi.dylib                     0x35d7c451 _ZdlPv + 0
11  libc++abi.dylib                     0x35d7d825 __cxa_current_exception_type + 0
12  libobjc.A.dylib                     0x37d6d2a9 objc_exception_rethrow + 12
13  CoreFoundation                      0x3591c50d CFRunLoopRunSpecific + 404
14  CoreFoundation                      0x3591c36d CFRunLoopRunInMode + 104
15  GraphicsServices                    0x375b8439 GSEventRunModal + 136
16  UIKit                               0x33428cd5 UIApplicationMain + 1080
17  myapp                               0x000d4293 _mh_execute_header + 41619
18  myapp                               0x000ccd20 _mh_execute_header + 11552
)

I can't find what caused this crash, but it is the most frequently appears in my app. I am very anxious, does any one know something about it? Thanks a lot.


回答1:


If you are able to reproduce this crash either by performing a certain task or just using the app long enough you could attach the debugger and set a breakpoint for [NSException raise]. This way you can figure out in what part of your application stuff is messed up, I used this in the past to figure out where a NSArray went out of bounds.. ( and I have like a dozen or more spread around all source files )

Secondly you should probably 'symbolicate' the crash report so you can follow the stack trace.. so you can figure out what method/class in your code is messing stuff up.




回答2:


For see a crash callback, try add in your project this great feature:

CrashKit

This is a exception catcher



来源:https://stackoverflow.com/questions/13871433/in-ios-what-caused-this-crash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!