Quote:
Originally Posted by badnewsbeers
Not specifically defined, I was doing it within the views. Assuming this is the wrong way to approach things. Back to the books.
|
Here's what to do:
Set up a data container singleton. At launch, create all your view controllers and save pointers to them in the singleton. That will cause you view controllers to stick around. When you need to push a view controller, fetch the existing view controller from the singleton and push it.
In each view controller's viewDidLoad method, set all the view settings the way you want them to be, using the view controller's instance variables, or a separate model object, if you have it separated out.
Make your view controllers respond to a low memory warning by releasing everything they can reproduce.
Your view controllers will stick around for the life of your application. Their views could be unloaded at any point when they are not frontmost, which is why you write code in your viewDidLoad that completely sets up your views.