Skip to content

Instantly share code, notes, and snippets.

@RawToast
Created October 13, 2015 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RawToast/86a70a34c1b4fe693e6e to your computer and use it in GitHub Desktop.
Save RawToast/86a70a34c1b4fe693e6e to your computer and use it in GitHub Desktop.
Catch everything iOS
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;
}
@RawToast
Copy link
Author

Sometimes this can be a useful starting point for when everything goes wrong and :)

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