Once I enable Zombies, how do I hunt them down?
Continuing some helpful StackO开发者_运维百科verflow 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?
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.
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.
精彩评论