void methodWithException(void) {
@try {
@throw [NSException
exceptionWithName:@"TestException"
reason:@"test exception"
userInfo:nil];
}
@catch (NSException *e) {
//partial processing, then pass
//the exception on: bare @throw
//re-raises the current one
NSLog(@"partial processing");
@throw;
}
}
@try {
methodWithException();
}
@catch (NSException *e) {
NSLog(@"%@", e.reason);
//printed 'test exception'
}