@try { NSException *exception = [NSException exceptionWithName: @"HotTeaException" reason: @"The tea is too hot" userInfo: nil]; @throw exception; } @catch (NSException *exception) { NSLog(@"main: Caught %@: %@", [exception name], [exception reason]); } @finally { NSLog(@"finally"); }
object-c 的异常构造,并抛出
最新推荐文章于 2024-01-28 12:07:47 发布