为什么我不能再释放对象? [英] Why can't I release an object anymore?

查看:66
本文介绍了为什么我不能再释放对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新到Xcode 4.2之后,我将不再释放任何内容. 当我开始输入"release"时,建议输入"release",但两边都有红线.

After I updated to Xcode 4.2, I can no longer release anything. When I start typing "release" it suggest "release" but with a red line across.

如果我仍然写它,它会显示一个错误并显示以下两条消息:

If I write it anyway it shows an error and displays these two messages:

发布"不可用:在自动引用计数模式下不可用 自动引用计数禁止显式发送发布"消息

'release' is unavailable: not available in automatic reference counting mode Automatic Reference Counting forbids explicit message send of 'release'

有人知道我能做什么吗?

Does anyone know what I can do?

推荐答案

您需要关闭自动引用计数.为此,请在导航器中单击项目(左侧为类似查找程序的顶部项),然后单击目标,选择构建设置" 并关闭选项"Objective-C自动引用计数" (您可以使用右上角的搜索字段进行搜索).

You need to turn off Automatic Reference Counting. You do this by clicking on your project in the navigator (the top item in the finder-like thing on the left), then click on your target, select "Build Settings" and turn off the option "Objective-C Automatic Reference Counting" (you can use the search field on the upper right to search it).

另一种可能性是迁移项目到ARC .

这篇关于为什么我不能再释放对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆