1
次のような理由で動作しないのでしょうか? try/catch questionと同様にObjective-cキャッチしようとしないでください
@try {
CFGetTypeID(NULL);
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
@finally {
NSLog(@"finally");
}
、それだけは毎回上記ブロッククラッシュしそうです。はい、非常に単純な理由がある
// Test working try catch
NSString* test = [NSString stringWithString:@"ss"];
@try {
[test characterAtIndex:6];
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
@finally {
NSLog(@"finally");
}
// Now test NULL entry
@try {
CFGetTypeID(NULL);
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
@finally {
NSLog(@"finally");
}