ARC forbids explicit message send of'release'

很显然,是ARC的问题。
错误原因:在创建工程的时候点选了“Use Automatic Reference Counting”选项,但是又调用了对象的release方法
 
ARC是什么?
 
ARC是iOS 5推出的新功能,全称叫 ARC(Automatic ReferenceCounting)。简单地说,就是代码中自动加入了retain/release,原先需要手动添加的用来处理内存管理的引用计数的代码可以自动地由编译器完成了。该机制在iOS 5/ Mac OS X 10.7 开始导入,利用 Xcode4.2可以使用该机制。简单地理解ARC,就是通过指定的语法,让编译器(LLVM3.0)在编译代码时,自动生成实例的引用计数管理部分代码。有一点,ARC并不是GC,它只是一种代码静态分析(StaticAnalyzer)工具。

解决办法:选择要项目,双击中间的工程名称,进入build setting

将中间的Objective-C Automatic Reference Counting改为no

OC中ARC forbids explicit message send of release错误(转)的更多相关文章

  1. OC中ARC forbids explicit message send of release错误

    在ios编程中,如果成员变量为对象,我们需要对成员变量内存管理,否则,会造成内存泄露.即我们要对成员变量进行手动的内存释放. 很显然,是ARC的问题. 错误原因:在创建工程的时候点选了“Use Aut ...

  2. Object-C中ARC forbids explicit message send of ' ' 错误

    OC中ARC forbids explicit message send of '...'错误 转自CSDN hahahacff 有所整理 ARC forbids explicit message s ...

  3. libXml ARC forbids explicit message send of'release'

    'release' is unavailable: not available in automatic reference counting mode ARC forbids explicit me ...

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

    在ios中经常会遇到:ARC forbids explicit message send of 'autorelease' 或“ARC forbids explicit message send of ...

  5. ARC forbids explicit message send of 'autorelease'错误

    (ARC forbids explicit message send of 'autorelease'错误) 在ios中经常会遇到:ARC forbids explicit message send ...

  6. ARC forbids explicit message send of release

    http://blog.sina.com.cn/s/blog_7b9d64af01019rqt.html

  7. ARC forbids explicit message send of'retain'解决办法

    项目中导入一些开源的类库,里面会爆出一些ARC forbids explicit message send of'retain' 这种问题 解决方法: 点击项目Target -> 找到" ...

  8. Object C学习笔记5-ARC forbids explicit message* 编译错误

    在学习Object C的过程中XCode 编译器经常出现 "ARC forbids explicit message send of release" 的错误提示. 以上问题主要出 ...

  9. OC中的内存管理

    一. 基本原理 1. 什么是内存管理 移动设备的内存极其有限,每个app所能占用的内存是有限制的 当app所占用的内存较多时,系统会发出内存警告,这时得回收一些不需要再使用的内存空间.比如回收一些不需 ...

随机推荐

  1. 知道版本对于出0day后批量攻击dedecms有非常大的帮助,先判断版本再选择相应exp,效率大增

    需要知道织梦网站版本URL路径后面添加/data/admin/ver.txt 例如:http://www.dedecms.com/data/admin/ver.txt 20100708是最新版本5.6 ...

  2. (五)boost库之随机数random

    (五)boost库之随机数random boost库为我们提供了许多的日常随机数生成器: 1.uniform_smallint:在小整数域内的均匀分布 2.uniform_int:在整数域上的均匀分布 ...

  3. hdu 5532 Almost Sorted Array(模拟)

    Problem Description We are all familiar with sorting algorithms: quick sort, merge sort, heap sort, ...

  4. [AS3]as3与JS的交互(AS3调用JS)实例说明

    一,AS3 vs JavaScript (1)AS3调用JS 函数: ExternalInterface.(functionName:, arguments): //AS3 Code 属性: 同上,通 ...

  5. UI设计师不可不知的安卓屏幕知识

    不少设计师和工程师都被安卓设备纷繁的屏幕搞得晕头转向,我既做UI设计,也做过一点安卓界面布局,刚好对这块内容比较熟悉,也曾在公司内部做过相关的讲座,在此,我将此部分知识重新梳理出来分享给大家! 1.了 ...

  6. SSCTF-PWN

    前几天比赛的PWN题,简单写了下. PWN400 漏洞是一个数组越界访问造成的任意地址读写.在对数据排序后,对数据进行查询和更新时,可以访问到数组以外一个元素(4个字节). 程序中存在3种数据结构,第 ...

  7. MYSQL报Fatal error encountered during command execution.错误的解决方法

    {MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command executio ...

  8. javascript之函数节流

    对于高频率的事件触发,为了优化页面性能,我们一般会对其做函数节流.比如: resize.keydow.scroll事件等.用户的频繁操作,会导致事件高频率的执行,这样会出现页面抖动啊.频繁调接口啊等问 ...

  9. 【.Net】从.NET平台调用Win32 API

    小序        Win32 API可以直接控制Microsoft Windows的核心,因为API(Application Programming Interface)本来就是微软留给我们直接控制 ...

  10. *++p和*p++的区别

    *p++:先是用*p这个值,然后再使p的地址加1. #include<iostream>using namespace std;int main(){    char s[81]=&quo ...