Once I enable Zombies, how do I hunt them down?

匿名 (未验证) 提交于 2019-12-03 10:24:21

问题:

Continuing some helpful StackOverflow debugging, I have a zombie I need to track down:

2010-08-22 10:18:51.111 AppName[106:307] *** -[CFString release]: message sent to deallocated instance 0x19f3b0

How would one find the variable name or whathaveyou for the 0x19f3b0 Zombie?

回答1:

Run the Allocations instrument, and enable "NSZombie Detection" and also turn on "track release/retain". Then as you are running, when the zombie is encountered, it pops up an alert and lets you drill down to explore what code released and retained the original object.



回答2:

Generally the way I do this is to hunt down the memory reference in the Object allocations instruments tool. It's tedious, but you can usually narrow it down to a few data types, of which usually only one will make sense in your context.

Of course, I only do this if I can't get good info out of the debugger.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!