From https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Exceptions/Tasks/HandlingExceptions.html:
@finally — Defines a block of related code that is subsequently executed whether an exception is thrown or not.
But it says nothing about exceptions in catch blocks.
It sounds logical that this exception wouldn't be cought.
I've made simple program to check that:
import <Foundation/Foundation.h>
int main(int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init] ;
int result = 0 ;
@try {
@throw [NSException exceptionWithName:@"Exception" reason:@"@try" userInfo:nil];
}
@catch (id exception) {
@throw [NSException exceptionWithName:@"Exception" reason:@"@catch" userInfo:nil];
}
@finally {
NSLog(@"Finally");
}
[pool release] ;
return result ;
}
Simply compile and execute that:
$ gcc -framework Foundation -fobjc-exceptions test.m
$ ./a.out
2012-12-29 00:39:21.667 a.out[86205:707] *** Terminating app due to uncaught exception 'Exception', reason: '@catch'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8e3050a6 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8e56e3f0 objc_exception_throw + 43
2 a.out 0x0000000107d48d47 main + 359
3 libdyld.dylib 0x00007fff90b4e7e1 start + 0
)
libc++abi.dylib: terminate called throwing an exception
Abort trap: 6