I have a root UIViewController subclass that has a UITabBar, (I'm not using UITabBarController) and 5 tab bar items for 5 view controllers. Each view controller has a UIPickerView. Only one view controller is ever instantiated at a time -- when a tab bar item is selected, the current one is removed, the new one is instantiated and added, and the old one is deallocated (self.oldvc = nil;). So if the user goes to the 3rd row of the picker in the first tab, then switches to the second tab, then goes back, I want the 3rd row of the picker to be selected again. Currently, I have it so the view controllers are instantiated with a initWithSelectedRowOfFirstComponent:(NSInteger)firstRow secondComponent:(NSInteger).. etc., and then in my root view controller, (the oner with the tab bar), I have an ivar to cache each of the values.. But I'm not sure.. Is there a better way to do this? Maybe a plist file or a dictionary or something.. I don't know, what do you think the best way to do this would be? Thanks!!
I decided to use UITabBarController, let memory warnings deallocate and use a class I called "Model" which is a singleton (using this macro) to hold the data to use when the views get unloaded because of memory warnings.