How to enable NSZombie in Xcode?

后端 未结 15 1922
梦毁少年i
梦毁少年i 2020-11-21 05:20

I have an app that is crashing with no error tracing. I can see part of what is going on if I debug, but can\'t figure out which object is \"zombie-ing\".

Does anyb

相关标签:
15条回答
  • 2020-11-21 05:58

    I encountered the same problem with troubleshooting EXC_BAD_ACCESS and had hard time to find the setting with Xcode 4.2 (the latest one that comes with iOS5 SDK). Apple keeps on moving things and the settings are no longer where they used to be.

    Fortunately, I've found it and it works for the device, not just Simulator. You need to open the Product menu in the Xcode, select Edit scheme and then choose the Diagnostics tab. There you have "Enable Zombie Objects". Once selected and run in debugger will point you to the double released object! Enjoy!

    In short

    Product->Edit Scheme->Diagnostics-> Click Enable Zombie Objects
    
    0 讨论(0)
  • 2020-11-21 06:00

    In Xcode 4.5.2 goto Product -> Edit Scheme -> and Under the Diagnostics tab check the check box in between Objective C and Enable Zombie Objects and Click on OK

    0 讨论(0)
  • 2020-11-21 06:05

    As of Xcode 3.2.5 and Snow Leopard (Mac OS X 10.6), you can run your code through the Zombies instrument: Run > Run with Performance Tool > Zombies. That allows you to see particular objects and their retain counts on a timeline.

    0 讨论(0)
  • 2020-11-21 06:08

    Product > Profile will pop up Instruments. Select zombies from the panel and go nuts.

    0 讨论(0)
  • 2020-11-21 06:11

    Here's a video and explaination how to use Instruments and NSZombie to find and fix memory crashes on iOS: http://www.markj.net/iphone-memory-debug-nszombie/

    0 讨论(0)
  • 2020-11-21 06:11

    NSZombieEnabled is used for Debugging BAD_ACCESS,

    enable the NSZombiesEnabled environment variable from Xcode’s schemes sheet.

    Click on Product⇒Edit Scheme to open the sheet and set the Enable Zombie Objects check box

    this video will help you to see what i'm trying to say.

    0 讨论(0)
提交回复
热议问题