I got an crash logs from a customer to figure why my app crash on her iPhone.
Here some info from crash log:
Exception Type: EXC_CRASH (SIGABRT) Exceptio
First, you need to symbolicate the crash log using the DSYM to understand what's happening. You'll need to have the DSYM file from the time that the application was built. The DSYM file allows you to reverse map from those memory addresses back to readable lines of code.
SIGABRT is the signal that you get when you have an unhandled exception, such as calling [someArray objectAtIndex:2]
if the array only had 1 item. Or, more often, an unrecognized selector: [NSArray unsignedIntValue]
.
Take a look at this crash log in this question. Note that the call stack libraries in Foundation are the same as your code - and it's an unrecognized selector.
Your code is:
NSNumber *num = foo;
if (num)
{
bar = [num unsignedIntValue];
}
What you haven't told us -- but is very important -- is what is in "foo". How do you assign that NSNumber? If it is any other object than an NSNumber, then your crash log will look like yours.
If you wanted to be REALLY defensive in your programming, you can say:
if (num && [num isKindOfClass:[NSNumber class]])
But really, whatever your "foo" is should always be returning an NSNumber.