Xcode-Cocoa “release is unavailable” Error

本文介绍了如何通过禁用Objective-C自动引用计数(ARC)来解决Xcode中出现的release不可用错误。主要步骤包括在项目的构建设置中将ARC设置为NO,并移除所有与引用计数相关的显式调用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1) Turn off ARC for this project. This is done by setting 'Objective-C Automatic Reference Counting'to NO in the 'Build Settings' tab of your target in the project page.

2) Remove all retain release autorelease NSAutoReleasePools and retainCount calls, since ARC makes them for you. With the exception of NSAutoReleasePools They have been replaced by @autorelease{}.


转帖:http://stackoverflow.com/questions/8236797/xcode-cocoa-release-is-unavailable-error

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ARC forbids explicit message send of'release'

ARC forbids explicit message send of'release'

'release' is unavailable: not available inautomatic reference counting mode

 

解决办法:

打开当前工程,打开"Build Settings",找到Objective-C Automatic Reference Counting项,将它的值设置为NO。

再次编译,就消除了这个错误了。


转帖:http://blog.youkuaiyun.com/baitxaps/article/details/6951286

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值