Zombies, demystifying the XIB, and console clearing: iPhone Cookbook Lessons
I’m on page 58 of the second edition of Erica Sadun’s “iPhone Developer’s Cookbook,” and here are the most important lessons I’ve learned so far:
- Zombies!
- What’s inside that XIB?
- The Clear Log Button
Zombies!
Did you know that, by default, your XCode project is NOT enabled to catch Zombies? And by zombies, I mean objects that you have released, but then subsequently try to access? THEY ARE ZOMBIES! They are the dead that still roam. This is good for horror films, but very bad for your code. But, by default, XCode’s debugger has no way to catch these nasties.
If you try and access a destroyed or released object, you’ll get back a cryptic objc_msgSend. But! If you ENABLE THE ZOMBIES as Sadun suggests, you’ll get back a much better message. In my case, I’m trying to access an array (via this call: CFShow([array self])) that I’ve already released. This gives me the following message in my gdb console:
2010-03-30 21:39:28.180 HelloWorld2[2398:207] *** -[CFArray self]: message sent to deallocated instance 0x1810260
Getting inside those .xib files
Read more »

follow me on twitter