I use NSSetUncaughtExceptionHandler
to print the stack trace to local file in iPhone, which will be sent to our server next time the app launches. Then I can examine the exception data and fix the bug.
In some crashes I have the module name and the function that threw the exception, these are easy.
But mostly I have something like this:
"4 libc++abi.dylib 0x35bba3c5 _ZL19safe_handler_callerPFvvE + 76",
"5 libc++abi.dylib 0x35bba451 _ZdlPv + 0",
"6 libc++abi.dylib 0x35bbb825 __cxa_current_exception_type + 0",
"7 libobjc.A.dylib 0x37bab2a9 objc_exception_rethrow + 12",
"8 CoreFoundation 0x3575a50d CFRunLoopRunSpecific + 404"
and for example the reason:
*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array
but I have dozens of arrays in my app, so I need help to find the specific line that threw the exception, using the data I get from the stack trace.
Does anyone know a good article/tutorial from Apple or other, where I can learn to decode the numbers in the stack trace to find the problematic line in the source code. Thanks in advance!