IainNotAndrew IainNotAndrew - 4 months ago 7x
iOS Question

Crash log without crash?

Hey this may be a stupid question but I couldn't find the answer anywhere, apologies if the answer is easily found and if my research skills are pants.

anyway is it possible to generate a crash report when an app doesn't crash? so say if a user encounters a bug could there be an option to allow them to generate a crash report which can then be sent to me? also how would I go about doing this?

Thanks for any help :)


I have used it couple of times when I had to print stack trace:

+ (NSArray *)backtrace
    void* callstack[128];
    int frames = backtrace(callstack, 128);
    char **strs = backtrace_symbols(callstack, frames);

    int i;
    NSMutableArray *backtrace = [NSMutableArray arrayWithCapacity:frames];
    for (
        i = UncaughtExceptionHandlerSkipAddressCount;
        i < UncaughtExceptionHandlerSkipAddressCount +
        [backtrace addObject:[NSString stringWithUTF8String:strs[i]]];

    return backtrace;

"When an application crashes on the iPhone, it disappears without telling the user what happened. However, it is possible to add exception and signal handling to your applications so that an error message can be displayed to the user or you can save changes. It is even possible to try to recover from this situation without crashing at all." Look at http://cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html