ARC forbids explicit message send of 'retainCount'

简介:

从字面上的解释就是:

arc禁止发送retainCount消息


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


解决步骤:

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

目录
相关文章
|
5月前
|
Python
7. 2023-11-20 12:29:32,542 [tornado.general :456 ][WARNING ][3052] Got events for closed stream Non
7. 2023-11-20 12:29:32,542 [tornado.general :456 ][WARNING ][3052] Got events for closed stream Non
|
9月前
|
JavaScript 安全 网络安全
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
Node: opensslErrorStack: [ ‘error:03000086:digital envelope routines::initialization error‘ ]异常处理
3556 1
Fatal error: Call to undefined function openssl_pkey_get_private()
Fatal error: Call to undefined function openssl_pkey_get_private()
94 0
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
|
Linux
error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
132 0
|
Java Go API
译|Don’t just check errors, handle them gracefully(二)
译|Don’t just check errors, handle them gracefully(二)
110 0
|
程序员 Go API
译|Don’t just check errors, handle them gracefully(一)
译|Don’t just check errors, handle them gracefully
92 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
|
C++
warning C4996 sprintf This function or variable may be unsafe
warning C4996 sprintf This function or variable may be unsafe
95 0