How to enable NSZombie in Xcode?

后端 未结 15 1920
梦毁少年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: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'. =)

提交回复
热议问题