Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone - how to find what object is it referring?

What's the point of Xcode showing the object address in messages like

[CALayer retain]: message sent to deallocated instance 0x1bc320

if when it happens you cannot find which object 0x1bc320 is?

Every time I see stuff like that I search the debugger for all objects that I can find and I never find which object is the one it is referring on the error message.

wasn't it logical just to say [CALayer retain]: message sent to deallocated instance.

Is that any way to find the object when that happens? Something I can type on console or something?

thanks

like image 511
Duck Avatar asked Mar 06 '11 21:03

Duck


1 Answers

Just type po 0x1bc320. You can also use allocations tracking in Instruments with NSZombie tracking enabled. That will halt the app and show you the full lifecycle of the zombied object and who called it after deallocation.

like image 101
Marc W Avatar answered Oct 05 '22 19:10

Marc W