views:

702

answers:

2

Whenever I push a view controller onto my stack, then pop it off, I get this error:

*** -[CALayer retainCount]: message sent to deallocated instance <memory address>

It seems to happen right after dealloc is called on the view controller that is being popped off and is exclusive to only this view controller. I'm sure the CALayer has something to do with the view itself, as I do not use them.

Any ideas?

Edit: Here is the backtrace

(gdb) bt
#0  0x01fcd3a7 in ___forwarding___ ()
#1  0x01fa96c2 in __forwarding_prep_0___ ()
#2  0x01fc10e8 in CFGetRetainCount ()
#3  0x01cbc770 in CA::release_root_if_unused ()
#4  0x01cbc707 in x_hash_table_remove_if ()
#5  0x01cbc4ec in CA::Transaction::commit ()
#6  0x01cc4838 in CA::Transaction::observer_callback ()
#7  0x01fa5252 in __CFRunLoopDoObservers ()
#8  0x01fa465f in CFRunLoopRunSpecific ()
#9  0x01fa3c48 in CFRunLoopRunInMode ()
#10 0x027dd615 in GSEventRunModal ()
#11 0x027dd6da in GSEventRun ()
#12 0x0057cfaf in UIApplicationMain ()
#13 0x00002dec in main (argc=1, argv=0xbfffeed0) 
A: 

I have a sneaking suspicion it has to do with the auto release pool...

Yakattak
A: 

I had similar issue; turns out I was not retaining a UIButton properly. How I found the cause: - Enable zombies - Run the project with 'Allocations' instrument - Use the app to trigger the bug - Check that Instruments show message 'Zombie Messaged' on the timeline - There should be a link that opens CALayer details: when it was allocated and deallocated - You are interested in the place where is was allocated, should be that aha!!! place in your code

Good luck!

dimzzy