ARC forbids explicit message send of 'retainCount'

简介:

从字面上的解释就是:

arc禁止发送retainCount消息


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


解决步骤:

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

目录
相关文章
|
5月前
|
NoSQL 编译器 API
关于thread使用的错误:pure virtual method called terminate called without an active exception
关于thread使用的错误:pure virtual method called terminate called without an active exception
100 1
|
5月前
|
消息中间件 Java
connection error;reply-code=503;unknown exchange type ‘x-delayed-message‘
connection error;reply-code=503;unknown exchange type ‘x-delayed-message‘
89 0
|
图形学 Android开发
Send Debug.NetworkRecordStart Error
Send Debug.NetworkRecordStart Error
82 1
VS2005 error C2864 only static const integral data members can be initialized within a class
VS2005 error C2864 only static const integral data members can be initialized within a class
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179)
344 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.
This error might indicate a memory leak if setState() is being called because another object is reta
This error might indicate a memory leak if setState() is being called because another object is reta
error: implicit declaration of function ‘read‘ [-Werror,-Wimplicit-function-declaration]
error: implicit declaration of function ‘read‘ [-Werror,-Wimplicit-function-declaration]
248 0
在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
|
C++
warning C4996 sprintf This function or variable may be unsafe
warning C4996 sprintf This function or variable may be unsafe
80 0