Skip to content

Instantly share code, notes, and snippets.

@grantland
Created October 31, 2012 20:12
Show Gist options
  • Save grantland/3989521 to your computer and use it in GitHub Desktop.
Save grantland/3989521 to your computer and use it in GitHub Desktop.
Printing stack traces in iOS 5+
// source: http://stackoverflow.com/questions/7841610/xcode-4-2-debug-doesnt-symbolicate-stack-call
void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
// Internal error reporting
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
// Normal launch stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment