I have strange behavior. My application being launched with UINavigationController
. If I push view controller ANavigationController
, go back and simulate memory warning everything works good.
If I push the same view controller (ANavigationController
) the same way, go back and simulate memory warning - application crashes with error:
[ANavigationController retain]
: message sent to deallocated instance.
While debugging this I've printed addresses of pushed controller and deallocated one:
- On first push - pushed controller address is
0xDA724F0
. - If I go back and simulate memory warning - all ok.
- Second push -
–dealloc
method of controller with address0xDA724F0
called. - New pushed controller address is
0xFA720F0
. - Going back and simulating memory warning crashes with error:
[ANavigationController retain]
: message sent to deallocated instance0xDA724F0
.
Edit
I'm using ARC.
Edit
After running Instruments to test allocations and enabling NSZombie i got crash in the expected place, however -1 reference count reported in UIkit
library and responsible Caller is:
+[UIViewController _traverseViewControllerHierarchyWithDelayedReleaseArray:block:]