Reputation: 5380
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:
0xDA724F0
.–dealloc
method of controller with address 0xDA724F0
called.0xFA720F0
.
[ANavigationController retain]
: message sent to deallocated instance0xDA724F0
.
I'm using ARC.
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:]
Upvotes: 2
Views: 1024
Reputation: 5380
I'm not sure whether this is a solution or a workaround for a problem but disabling ARC for this specific file resolved this problem. Of course I had to go and to manage memory by myself.
Still I'll appreciate any clue for what is the problem.
EDIT
Found a solution to this. Please see my answer to my other question: [UINavigationController retain]: message sent to deallocated instance
Upvotes: 0