1 2 3 4 5 6 7 8 9 10 11 12 13 14
#import <Foundation/Foundation.h> int main(int argc, char const *argv[]) { @try { NSException *e = [[NSException alloc] initWithName:@"ThrownException" reason:@"SomeReason" userInfo:nil]; @throw e; } @catch (NSException *e) { NSLog(@"Caught %@", e); @throw; // let the process crash... } return 0; }