Last active
December 20, 2015 16:18
-
-
Save dwineman/6160121 to your computer and use it in GitHub Desktop.
Magic for your main.m to force exception logging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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