当前位置: 移动技术网 > IT编程>移动开发>IOS > iOS 抛出异常@throw解决方案

iOS 抛出异常@throw解决方案

2018年04月19日  | 移动技术网IT编程  | 我要评论

襄樊男科,婶婶的,网游之修罗至尊

有时候我们项目需求,需要人为的抛出异常,使程序崩溃退出,这时候就用到@throw了

 @throw [NSException exceptionWithName:@"context show" reason:@"crush's reason" userInfo:nil];

运行程序就会出现如下打印结果:

Terminating app due to uncaught exception 'context show', reason: 'crush's reason'

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网