ios开发之路十一(ARC forbids explicit message send of 'autorelease'错误)

在ios中常常会遇到:ARC forbids explicit message send of 'autorelease' 或“ARC forbids explicit message send of release”这样的错误。缘由多是项目使用了arc机制而有些文件禁止使用而报错,ios

解决方法:ui

1.禁用在Xcode中的特定文件的ARCspa

点击项目名,在中间一栏选择targets,而后选择build phases选项。.net

展开Compile Sources,找到你报错的文件名,而后双击添加-fno-objc-arc:以下图:code


 

方法二:把整个项目改为非arc机制的:blog

在build Settings中:把Objective-C Automatic Reference Co....设为NO:ci

 


 

转载请注明:get

新浪微博:http://weibo.com/u/3202802157

相关文章
相关标签/搜索