如何在Xcode 4中设置NSZombieEnabled? [英] How do I set up NSZombieEnabled in Xcode 4?
问题描述
如何在Xcode 4中为可执行文件设置NSZombieEnabled
和CFZombieLevel
?
How do I set up NSZombieEnabled
and CFZombieLevel
for my executable in Xcode 4?
推荐答案
在Xcode 4.x中按
In Xcode 4.x press
(或单击Menubar
> Product
> Scheme
> Edit Scheme
)
(or click Menubar
> Product
> Scheme
> Edit Scheme
)
选择诊断"标签,然后单击启用僵尸对象":
select the "Diagnostics" tab and click "Enable Zombie Objects":
这会将释放的对象转换为NSZombie实例,并在再次使用时打印控制台警告.这是一个调试辅助工具,可以增加内存使用量(实际上没有释放任何对象),但可以改善错误报告.
This turns released objects into NSZombie instances that print console warnings when used again. This is a debugging aid that increases memory use (no object is really released) but improves error reporting.
一种典型的情况是,当您过度释放一个对象却不知道是哪个对象时:
A typical case is when you over-release an object and you don't know which one:
- 有僵尸:
-[UITableView release]: message sent to deallocated instance
- 没有僵尸:
当您存档应用程序以提交App Store时,将忽略此Xcode设置.在发布应用程序之前,您无需触摸任何东西.
This Xcode setting is ignored when you archive the application for App Store submission. You don't need to touch anything before releasing your application.
在按住 Alt 键的同时,按⌥ selecting R 等同于选择产品">运行".
单击启用僵尸对象"复选框与在参数"选项卡的环境变量"部分中手动添加"NSZombieEnabled = YES"相同.
Pressing ⌥⌘R is the same as selecting Product > Run while keeping the Alt key pressed.
Clicking the "Enable Zombie Objects" checkbox is the same as manually adding "NSZombieEnabled = YES" in the section "Environment Variables" of the tab Arguments.
这篇关于如何在Xcode 4中设置NSZombieEnabled?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!