ARC forbids explicit message send of release-关闭xCode项目的ARC设置
来源:互联网 发布:手机扫描照片软件 编辑:程序博客网 时间:2024/05/02 01:22
转自:http://blog.sina.com.cn/s/blog_7b9d64af01019rqt.html
ARC forbids explicit message send of 'release'
'release' is unavailable: not available in automatic reference counting mode
今天,遇到了这么样的问题。
很显然,是ARC的问题。
错误原因:因为我们设置了用ARC来管理内存释放,我们却又调用了release方法去释放对象。
ARC是什么?(我也贴一段网上的简短说明)
ARC是iOS 5推出的新功能,全称叫 ARC(Automatic Reference Counting)。简单地说,就是代码中自动加入了retain/release,原先需要手动添加的用来处理内存管理的引用计数的代码可以自动地由编译器完成了。该机制在 iOS 5/ Mac OS X 10.7 开始导入,利用 Xcode4.2 可以使用该机制。简单地理解ARC,就是通过指定的语法,让编译器(LLVM 3.0)在编译代码时,自动生成实例的引用计数管理部分代码。有一点,ARC并不是GC,它只是一种代码静态分析(Static Analyzer)工具。
解决方法:
看图说话吧:
搞定!
还有一种情况:
当引入外部或者第三方库的时候,有的需要ARC支持,有的却不需要甚至不允许。遇到这种,情况该如何设置?
分别设置ARC选项
分别解决呗。
看图说话:
需要使用ARC支持的输入 -fobjc-arc
不使用ARC机制,只需要输入 -fno-objc-arc
0 0
- ARC forbids explicit message send of release-关闭xCode项目的ARC设置
- ARC forbids explicit message send of release-关闭xCode项目的ARC设置
- ARC forbids explicit message send of release-关闭xCode项目的ARC设置
- ARC forbids explicit message send of release-关闭xCode项目的ARC设
- (转载)ARC forbids explicit message send of release-关闭xCode项目的ARC
- xcode ARC forbids explicit message send of 'release'
- ARC forbids explicit message send of'release'
- ARC forbids explicit message send of'release'
- ARC forbids explicit message send of 'release
- ARC forbids explicit message send of'release'
- ARC forbids explicit message send of'release'
- ARC forbids explicit message send of'release'
- ARC forbids explicit message send of'release'
- ARC forbids explicit message send of'release'
- ARC forbids explicit message send of release
- ARC forbids explicit message send of "release"
- ARC forbids explicit message send of release
- ARC forbids explicit message send of release-关闭xCode项目的ARC设 此博文包含图片 (2012-12-17 22:28:59)
- PCI E ,USB,1394“接口”的带宽计算
- 今天第一次面试别人, 大概聊了近30分钟, 呵呵。
- numpy性能优化
- Android SDK更新以及ADT更新出现问题的解决办法
- Android View 事件分发机制 源码解析 (上)
- ARC forbids explicit message send of release-关闭xCode项目的ARC设置
- 秋天里
- Direct2D 1.1 开发笔记 特效篇(四) 图形调试
- Burberry outlet Black dress namely looked above as a sign of sexuality and means When it comes apt t
- kate spade new york You tin buy as many Gucci handbags as you tin
- kate spade outlet store Prada handbag is absolutely an important accompanying that reveals the indiv
- cheap chanel bags It namely said that women are born apt be fashionable
- faux louis vuitton Fendi
- cheap chanel bags The additional daytime I saw my friend wearing a Lacoste polo shirt