有时候调试需求,需要人为的抛出异常,使程序崩溃退出,这时候就用到@throw
@throw [NSException exceptionWithName:@"context show" reason:@"crush's reason" userInfo:nil];
运行程序会出现如下打印:
Terminating app due to uncaught exception 'context show', reason: 'crush's reason'
有时候调试需求,需要人为的抛出异常,使程序崩溃退出,这时候就用到@throw
@throw [NSException exceptionWithName:@"context show" reason:@"crush's reason" userInfo:nil];
运行程序会出现如下打印:
Terminating app due to uncaught exception 'context show', reason: 'crush's reason'
本文标题:iOS主动抛出异常@throw
本文链接:https://www.haomeiwen.com/subject/urjprltx.html
网友评论