Specifically, what am I supposed to do with the view that is now hidden after pushing on a new view controller?
In my situation I have a view with animations going on, that continue to execute after the view is off screen.
Is there some accepted convention? Do I remove the View Controller and View from memory?
Does Cocoa Touch have a convenient method to ‘Pause’ a view (and controller) and remove it from memory, and bring it back into existence when needed (after a pop)? Do I have to archive it myself and then un-archive it?
Are there any examples you can point me to?
Thanks
Under low memory conditions, your controller’s ‘view’ property will automatically be set to nil, if it’s not on screen. Then the view will automatically load again when it is needed – and viewDidLoad should get called at that time.
If your view controller is retaining any subviews of the top-level view, then you may want to override the view controller’s setView: method, check if the view is being set to nil, and if so, release subviews that you were retaining. Otherwise, the top-level view may never get deallocated.