views:

35

answers:

2

I've got an app that initially loads in one view controller for a period of time before it's replaced by a UINavigationController (and its corresponding root view controller) in the Window's view. Once the app is being managed by the Navigation Controller I am releasing the previous View Controller and its View. It's difficult for me to confirm that the retain count has reached zero and these objects have successfully been released.

Simply asking for its retainCount is unreliable - as it is for many private objects in the framework. Using the Debugger to follow the object's life quickly turns to "out of scope" messages before, what I understand about the debugger, allows me to see the objects to their demise. What can I do to verify objects are being released properly (aside from over-releasing to the point of crashing)? Perhaps something in ObjectAlloc in Instruments?

+1  A: 

Hmm... I'm not sure but you can try to show some message in - (void) dealloc method of object of interest.

Morion
A: 

Yes, Instruments will do this just fine. Use the ➲ buttons in the list—they're invaluable for this. They'll let you view all the instances of a specific class, and then all the memory events for a specific memory address.

Peter Hosey