Object-C中ARC forbids explicit message send of ' ' 错误
OC中ARC forbids explicit message send of '...'错误
转自CSDN hahahacff
有所整理
ARC forbids explicit message send of'retainCount'
- 同'release'等等

很显然,是ARC的问题。
错误原因:在创建工程的时候点选了“Use Automatic Reference Counting”选项,但是又调用了对象的retainCount方法
ARC是什么?
ARC是iOS 5推出的新功能,全称叫ARC(AutomaticReferenceCounting)。
简单地说,就是代码中自动加入了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
Object-C中ARC forbids explicit message send of ' ' 错误的更多相关文章
- OC中ARC forbids explicit message send of release错误(转)
ARC forbids explicit message send of'release' 很显然,是ARC的问题. 错误原因:在创建工程的时候点选了“Use Automatic Reference ...
- OC中ARC forbids explicit message send of release错误
在ios编程中,如果成员变量为对象,我们需要对成员变量内存管理,否则,会造成内存泄露.即我们要对成员变量进行手动的内存释放. 很显然,是ARC的问题. 错误原因:在创建工程的时候点选了“Use Aut ...
- ios开发之路十一(ARC forbids explicit message send of 'autorelease'错误)
在ios中经常会遇到:ARC forbids explicit message send of 'autorelease' 或“ARC forbids explicit message send of ...
- ARC forbids explicit message send of 'autorelease'错误
(ARC forbids explicit message send of 'autorelease'错误) 在ios中经常会遇到:ARC forbids explicit message send ...
- ARC forbids explicit message send of'retain'解决办法
项目中导入一些开源的类库,里面会爆出一些ARC forbids explicit message send of'retain' 这种问题 解决方法: 点击项目Target -> 找到" ...
- libXml ARC forbids explicit message send of'release'
'release' is unavailable: not available in automatic reference counting mode ARC forbids explicit me ...
- ARC forbids explicit message send of release
http://blog.sina.com.cn/s/blog_7b9d64af01019rqt.html
- Object C学习笔记5-ARC forbids explicit message* 编译错误
在学习Object C的过程中XCode 编译器经常出现 "ARC forbids explicit message send of release" 的错误提示. 以上问题主要出 ...
- android中handler中 obtainmessge与New message区别
obtainmessage()是从消息池中拿来一个msg 不需要另开辟空间new new需要重新申请,效率低,obtianmessage可以循环利用: //use Handler.obtainMess ...
随机推荐
- 经典网页设计:20个华丽的 iPhone 应用程序演示网站
一个物品销售很好,重要的原因之一是它的包装,因为这是最重要的细节,可以把一个人转变成购买者.一个好的包装设计和良好的表现比产品本身更重要,因此被分配了大量的金钱和资源,以创造伟大的东西. 因此,为了销 ...
- css布局模式
css布局模型在网页中,元素有三种布局模型: 流动模型(Flow) 浮动模型 (Float) 层模型(Layer) 流动Flow模型(一): 流动(Flow)是默认的网页布局模式.也就是说网页在默认状 ...
- Javascript Object、Function对象
1.Object对象 原型对象 原型是对象的一个属性,也就是prototype属性,每个对象都有这个内部属性,而且他本身也是一个对象. <script type="text/javas ...
- css3中的animation
不使用js或jquery,用css3实现一张图片的滑动.我用的是animation来设置所要应用的动画效果,首先在html中写好一个<div></div>,并放置一张图片在di ...
- 渗透测试常规思路分析-FREEBUF
最基础但练得好最后也非常厉害 1. 主要由于服务器配置等原因造成的信息泄露 常用google ,bing等搜索工具,轻量级的搜索出一些遗留后门,不想被发现的后台入口,中量级的搜索出一些用户信息泄露, ...
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q6-Q8)
Question 6 You are designing a SharePoint 2010 solution that allows users to enter address informat ...
- android遥控器的映射
第一编写kl文件时先在盒子上输入getevent -v查看设备信息,设备信息里有vendor.product.version, 假如分别是xxxx,yyyy,zzzz,那么你的文件名就要命名为Vend ...
- UITableView相关知识点
//*****UITableView相关知识点*****// 1 #import "ViewController.h" // step1 要实现UITableViewDataSou ...
- OC中的私有变量和description
.OC中的私有变量 在类的实现即.m @implementation中也可以声明成员变量,但是因为在其他文件中通常都只 是包含头文件而不会包含实现文件,所以在.m文件中声明的成员变量是@private ...
- IOS中十六进制的颜色转换为UIColor
IOS中十六进制的颜色转换为UIColor #pragma mark - 颜色转换 IOS中十六进制的颜色转换为UIColor + (UIColor *) colorWithHexString: (N ...