Xcode Instruments - 启用 NSZombie 检测?它在哪里?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5215176/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:23:57  来源:igfitidea点击:

Xcode Instruments - Enable NSZombie Detection? Where is it?

xcodeiosmemory-managementinstruments

提问by DuckDucking

I have watched this video http://www.markj.net/iphone-memory-debug-nszombie/

我看过这个视频 http://www.markj.net/iphone-memory-debug-nszombie/

The guy shows an option called Enable NSZombie Detection on Allocations inside instruments, but my Instruments doesn't shows this option. This guy's video was done using a one year old version of Instruments and I am using Xcode 3.2.5. Do you guys know where this option is now? How can I enable it for iPhone apps?

这家伙显示了一个名为 Enable NSZombie Detection on Allocations inside Instruments 的选项,但我的 Instruments 没有显示此选项。这家伙的视频是使用一年前的 Instruments 版本完成的,我使用的是 Xcode 3.2.5。你们知道现在这个选项在哪里吗?如何为 iPhone 应用程序启用它?

thanks

谢谢

回答by Aditya Kumar Pandey

In XCode 4.0, this 'Enable Zombie' option is only present in iPhone simulator and not when you profile on actual device.

在 XCode 4.0 中,此“启用僵尸”选项仅出现在 iPhone 模拟器中,而不会出现在您在实际设备上进行配置时。

回答by Mark Johnson

The zombie option is available in Xcode 3.2.6 under the allocations tool if you run in the simulator. For debugging memory crashes due to too many dealloc, the simulator will work just as well as the device nearly every time. BTW I am 'The guy' in the question ;-)

如果您在模拟器中运行,则僵尸选项在 Xcode 3.2.6 的分配工具下可用。为了调试由于dealloc过多而导致的内存崩溃,模拟器几乎每次都可以像设备一样工作。顺便说一句,我是问题中的“那个人”;-)

enter image description here

在此处输入图片说明

回答by ericg

You can find it in Instruments in the Allocations Instrument. The easiest thing to do is to select:

您可以在分配工具中的工具中找到它。最简单的做法是选择:

Run -> Run with Performance Tool -> Allocations

运行 -> 使用性能工具运行 -> 分配

This will start the application and Instruments will start recording. However, the Zombie detection may be off. To turn it on, stop the recording, click on the 'i' icon, and check 'Enable NSZombie detection'. Once it is enabled, start the recording again.

这将启动应用程序,仪器将开始记录。但是,僵尸检测可能已关闭。要打开它,请停止录制,单击“i”图标,然后选中“启用 NSZombie 检测”。启用后,再次开始录制。

It should be noted that in XCode 4.0, one can only enable zombie detect in the simulator, not when running on a device.

需要注意的是,在 XCode 4.0 中,只能在模拟器中启用僵尸检测,而不能在设备上运行时启用。