xcode 4垃圾回收删除了吗? [英] xcode 4 garbage collection removed?

查看:108
本文介绍了xcode 4垃圾回收删除了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Xcode和目标c,但是我正在阅读的书使用的是Xcode的旧版本(3.2).一章完全致力于内存和泄漏,说我需要通过项目设置">构建"打开垃圾收集.但是,我找不到垃圾收集设置.它已被删除还是我只是想念它?

I am learning Xcode and objective c, but the book I am reading is using the older version (3.2) of Xcode. One chapter, which is completely dedicated to memory and leaks, says I need to turn on garbage collection through Project Settings > Build. However, I can't find the garbage collection setting. Has it been removed or am I just missing it?

推荐答案

Xcode 4仍具有垃圾回收,您要做的只是进入您的项目(导航栏中带有大xcode项目图标的顶部选项).选择您的目标,该目标应仅是您的应用程序名称,旁边是应用程序图标.选择该选项后,顶部会出现一个带有不同选项的栏,例如摘要,信息,构建设置等.单击构建设置",然后在搜索字段中键入"garbage".然后将垃圾回收设置为必填.

Xcode 4 still has Garbage Collection, all you do is go into your project (the top option in the navigation bar with the big xcode project icon). Select your target which should just be the name of your app with the application icon next to it. When you select that, along the top there is a bar with different options, such as summary, info, build settings etc. Hit "Build Settings" and type "garbage" in the search field. Then set garbage collection to required.

关于GC的一个非常重要的注意事项是,从Mac OS 10.8开始,它已正式弃用,这意味着,如果可能的话,您应该将代码转换为ARC,因为GC可能存在的时间不长.

One very important note about GC is that it is officially deprecated as of Mac OS 10.8, which means you should be transitioning your code to ARC if possible because GC might not be around for much longer.

更新:请参见在当前版本的Xcode中启用GC的其他答案.如上所述,如果您尚未迁移到ARC,则应该过渡.

Update: See other answers for enabling GC in current versions of Xcode. As I stated above, you should be transitioning to ARC if you haven't already.

这篇关于xcode 4垃圾回收删除了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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