How to enable NSZombie in Xcode?

后端 未结 15 2004
梦毁少年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:53

    in ur XCODE (4.3) next the play button :) (run)

    select : edit scheme

    the scheme management window will open

    click on the Arguments tab

    you should see : 1- Arguments passed on launch 2- environment variables

    inside the the (2- environment variables) place Name: NSZombieEnabled
    Value: YES

    And its done....

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

    To enable Zombie logging double-click the executable in the executables group of your Xcode project. At this point click the Arguments tab and in the Variables to be set in the environment: section, make a variable called NSZombieEnabled and set its value to YES.

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

    In XCode 4.0: To detect NSZombie in Instruments, select the Simulator as your target (can't detect NSZomboe on device). Run Instruments (CMD+I) and select "Zombies" trace template. Enjoy.

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

    In the preferences of your executable add the environment variable NSZombieEnabled and set the value to YES.

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

    It's a simple matter of setting an environment variable on your executable (NSZombieEnabled = YES), and then running/debugging your app as normal.If you message a zombie, your app will crash/break to debugger and NSLog a message for you.

    For more information, check out this CocoaDev page: http://www.cocoadev.com/index.pl?NSZombieEnabled

    Also, this process will become much easier with the release of 10.6 and the next versions of Xcode and Instruments. Just saying'. =)

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

    Environment variables are now part of the "scheme".

    To edit the scheme and turn on zombies:

    • In the "Product" menu, select "Edit Scheme".

    • Go to the "Run Foo.app" stage in the left panel, and the "Arguments" tab on the right.

    • Add NSZombieEnabled to the "Environment Variables" section and set the value to YES, as you could in Xcode 3.


    In Xcode 4.1 and above, there's also a checkbox on the "Diagnostics" tab of the "Run" stage to "Enable Zombie Objects".


    With Xcode 6.4:

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