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)工具。

解决方法

  1. 选择要项目,双击中间的工程名称,进入build setting
  2. 将中间的Objective-C Automatic Reference Counting改为no

Object-C中ARC forbids explicit message send of ' ' 错误的更多相关文章

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

    ARC forbids explicit message send of'release' 很显然,是ARC的问题. 错误原因:在创建工程的时候点选了“Use Automatic Reference ...

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

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

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

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

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

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

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

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

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

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

  7. ARC forbids explicit message send of release

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

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

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

  9. android中handler中 obtainmessge与New message区别

    obtainmessage()是从消息池中拿来一个msg 不需要另开辟空间new new需要重新申请,效率低,obtianmessage可以循环利用: //use Handler.obtainMess ...

随机推荐

  1. HTML表格边框的设置小技巧

    对于很多初学HTML的人来说,表格<table>是最常用的标签了,但对于表格边框的控制,很多初学者却不甚其解. 对于很多初学HTML的人来说,表格<table>是最常用的标签了 ...

  2. Windows 安装 GTK+ 图文说明

    首先去官方下载: //官方网站 http://www.gtk.org/download/index.php //下载链接 http://win32builder.gnome.org/gtk+-bund ...

  3. 定制Eclipse IDE之插件篇(二)

    上文回顾:定制Eclipse IDE之插件篇(一) 延续上一篇的插件篇,这一篇将会讲到一个最关键的插件aptana. 一.aptana插件 官方的解释我就不说了,从下面图可以看到插件提供了什么功能,列 ...

  4. [转]搭建Maven私服

    在开发过程中,有时候会使用到公司内部的一些开发包,显然把这些包放在外部是不合适的.另外,由于项目一直在开发中,这些内部的依赖可能也在不断的更新.可以通过搭建公司内部的Maven服务器,将第三方和内部的 ...

  5. .net MVC 连接数据本地数据库三种方法

    <appSettings> <add key="webpages:Version" value="2.0.0.0" /> <add ...

  6. 劳动节脑洞大开!利用Debug API 获取 加壳客户端的MD5值

    系统 : Windows xp 程序 : 某游戏客户端 程序下载地址 :不提供 要求 : 远程注入 & 获取MD5值 使用工具 : vc++6.0 & OD 案例说明: 该游戏客户端对 ...

  7. flume 集群安装

    ./pssh -h ./host/all.txt -P mkdir /usr/local/app ./pssh -h ./host/all.txt -P tar zxf /usr/local/soft ...

  8. [转]MOSS通过此命令注册模板,web应用程序可以根据stp模块生成网站集

    注:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\bin          stsadm –o add ...

  9. phonegap + Framework7 之 ios 推送跳转测试

    先说说项目情况:使用phonegap创建的ios项目,然后在使用html + css开发网页中又使用了一个框架Framework7(Framework7是一个构建仿原生ios和android应用的框架 ...

  10. 如何处理 android 方法总数超过 65536 . the number of method references in a .dex file exceed 64k

    一:问题描述:     应用中的Dex 文件方法数超过了最大值65536的上限,简单来说,应用爆棚了. 二.解决方案:      方案1:使用插件化框架  比如: https://github.com ...