Cor*_*art 1 objective-c try-catch-finally nsexception ios
是否有以下原因无效?
@try {
CFGetTypeID( NULL );
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
@finally {
NSLog(@"finally");
}
Run Code Online (Sandbox Code Playgroud)
与try/catch问题类似,只是看起来上面的块每次都崩溃了.我知道我的调试器设置正确,因为我从另一个问题设置了一个try/catch:
// 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");
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2805 次 |
| 最近记录: |