美文网首页
@try - @catch编译时报错

@try - @catch编译时报错

作者: 智狸 | 来源:发表于2019-02-01 09:50 被阅读0次

在项目中使用@try - @catch编译时报错,原因是因为你没有打开异常配置信息。

Cannot use '@try' with Objective-C exceptions disabled

需要设置(Xcode10.1为例):

TARGET -> Build Settings -> Apple LLVM 9.0 - Language - Objective C -> Enable Objective-C Exceptions 

为:Yes 即可。

相关文章

网友评论

      本文标题:@try - @catch编译时报错

      本文链接:https://www.haomeiwen.com/subject/tibrsqtx.html