Skip to content

Instantly share code, notes, and snippets.

@william8th
Created October 13, 2015 08:38
Show Gist options
  • Save william8th/30002ad5a2269547f131 to your computer and use it in GitHub Desktop.
Save william8th/30002ad5a2269547f131 to your computer and use it in GitHub Desktop.
iOS try-catch main
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;
}
@EvgenyKarkan
Copy link

What is the pros of doing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment