当前位置:首页 > 操作系统 > Ios

IOS开发 ARC forbids explicit message send of 'autorelease'错误解决办法

在ios中经常会遇到:ARC forbids explicit message send of ‘autorelease‘ 或“ARC forbids explicit message send of release”这样的错误。原因可能是项目使用了arc机制而有些文件禁止使用而报错.

技术分享

解决方法:

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

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

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

技术分享

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

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

技术分享

 

'错误解决办法' ref='nofollow'>IOS开发 ARC forbids explicit message send of 'autorelease'错误解决办法

原文:http://www.cnblogs.com/wudongyang/p/4344141.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!