Created
October 13, 2015 08:38
-
-
Save william8th/30002ad5a2269547f131 to your computer and use it in GitHub Desktop.
iOS try-catch main
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
int main(int argc, char *argv[]) { | |
int retVal = -1; | |
@autoreleasepool { | |
@try { | |
retVal = UIApplicationMain(argc, argv, nil, nil); | |
} | |
@catch (NSException* exception) { | |
NSLog(@"Uncaught exception: %@", exception.description); | |
NSLog(@"Stack trace: %@", [exception callStackSymbols]); | |
} | |
} | |
return retVal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the pros of doing this?