ARC forbids explicit message send of 'retainCount'

简介:

从字面上的解释就是:

arc禁止发送retainCount消息


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


解决步骤:

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

目录
相关文章
|
2月前
|
NoSQL 编译器 API
关于thread使用的错误:pure virtual method called terminate called without an active exception
关于thread使用的错误:pure virtual method called terminate called without an active exception
24 1
error `slot` attributes are deprecated
error `slot` attributes are deprecated
|
24天前
|
JavaScript 前端开发
报错:Cannot read properties of undefined (reading ‘$message‘)解决方法
以上就是解决"Cannot read properties of undefined (reading ‘$message‘)"错误的几种方法,希望对你有所帮助。
122 0
|
8月前
Fatal error: Call to undefined function openssl_pkey_get_private()
Fatal error: Call to undefined function openssl_pkey_get_private()
50 0
|
2月前
|
消息中间件 Java
connection error;reply-code=503;unknown exchange type ‘x-delayed-message‘
connection error;reply-code=503;unknown exchange type ‘x-delayed-message‘
57 0
|
7月前
报错modify sync object Modify sync object Failed!
报错modify sync object Modify sync object Failed!
28 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
|
11月前
|
数据安全/隐私保护
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
Do Sync Disk 0 Part 0 Failed, code=S3_F42, msg=Sync Failed after retry 5 times
159 1
|
Java Android开发
Bad method handle type 7异常解决
在利用androidx版本写demo时,在添加了一些依赖后,遇到了`java.lang.ClassNotFoundException`bug,这就很奇怪了,我就添加rxjava3的依赖,就给我报这个错误。
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.