Using multiple viewControllers, memory advise
Dear All
I'm creating an iPad application, based on a split view controller.
My detail (or right) view controller features a scroll view where I need to add multiple view controllers.
Each view controller (instantiated on the scroll view) requires a large amount of memory, it contains a picture, some buttons and so on.
My question is : How to handle memory management for such a situation ?
Basically I created an array of view controllers, so I keep a reference on each instantiated viewcontroller, and each time a button on any viewcontroller is pressed, I'm able to perform the corresponding action.
Unfortunatelly I have some memory issues due to the large number of instanciated viewcontrollers.
Releasing these view controllers once their view is added to the scrollview does not work since I loose the viewcontroller reference, thus pressing a button of the released viewcontroller result in a call to a deallocated viewcontroller.
So what would be the best practice for instantiating multiple view controllers in a scrollview ?
Is there a way to save (to file ?) a reference of the viewcontroller ? so I can free up memory and reallocated once required ?
Any help would be greatly appreciated !
Thanks
J
|