Skip to content

Instantly share code, notes, and snippets.

@dwineman
Last active December 20, 2015 16:18
Show Gist options
  • Save dwineman/6160121 to your computer and use it in GitHub Desktop.
Save dwineman/6160121 to your computer and use it in GitHub Desktop.
Magic for your main.m to force exception logging.
static void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"EXCEPTION: %@", exception);
NSLog(@"Stack trace: %@", [exception callStackSymbols]);
}
int main(int argc, char *argv[]) {
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MyAppDelegate class]));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment