ARC forbids explicit message send of 'retainCount'

简介:

从字面上的解释就是:

arc禁止发送retainCount消息


其实就是使用ARC之后,不允许直接调用retain,release,autorelease,dealloc,retainCount这些方法了,编译器会在合适的地方将这些代码添加进去,解决这样的问题只需要手动删除管理内存相关的代码(一般就是报错的代码)即可。


解决步骤:

打开当前工程,打开“Build Settings”,找到Objective-c Automatic reference counting,将它的值设为NO。

目录
相关文章
|
3月前
|
消息中间件 Java
connection error;reply-code=503;unknown exchange type ‘x-delayed-message‘
connection error;reply-code=503;unknown exchange type ‘x-delayed-message‘
33 0
error: static assertion failed: Signal and slot arguments are not compatible.
error: static assertion failed: Signal and slot arguments are not compatible.
error: static assertion failed: Signal and slot arguments are not compatible.
在main函数中创建新对象时出错 No enclosing instance of type ooo is accessible. Must qualify the allocation with a
在main函数中创建新对象时出错 No enclosing instance of type ooo is accessible. Must qualify the allocation with a
在main函数中创建新对象时出错 No enclosing instance of type ooo is accessible. Must qualify the allocation with a
如何处理错误消息Unable to install breakpoint due to missing line number attributes
如何处理错误消息Unable to install breakpoint due to missing line number attributes
160 0
如何处理错误消息Unable to install breakpoint due to missing line number attributes
OPA 11 - how is check called in my iClickTheCreateButton
Created by Wang, Jerry, last modified on Nov 08, 2015
126 0
OPA 11 - how is check called in my iClickTheCreateButton
Object C学习笔记5-ARC forbids explicit message* 编译错误
  在学习Object C的过程中XCode 编译器经常出现 "ARC forbids explicit message send of release" 的错误提示。   以上问题主要出现在release,retain 等操作的时候,这是因为你在新建工程的时候使用ARC功能.
755 0