I’m using a TabBarController with a few Tabs and I have memory problems when switching through the tabs and the contents. Is there a way to release and dealloc everything when I go to another ViewController ?
So when I am in Tab#1 with ViewController #1 and I go to Tab#2 with ViewController #2, how can I free all the memory ViewController #1 took ?
Thx !
Sebastian
The tab bar controller retains all its view controllers so unless you remove the corresponding tab from the tab bar, you cannot free all the memory the view controller takes. However, a view controller should usually not require a lot of memory except for its view. Make sure you release all your outlets (and everything else that can be recreated in
viewDidLoad) inviewDidUnload. If your view controller holds significant other amounts of data, you should release them indidReceiveMemoryWarningif you can recreate them later.