I have a mainwindow.xib file with a UITabBarController
as the base view controller of the app. So inside the UITabBarController I've added about 10 sub UIViewController
objects as tabs. Most of them are just a UITableViewController
subclass or a UINavigationController
containing a UITableViewController
subclass.
In this design, each UIViewController
is fully loaded on app startup, including calling the viewDidLoad
method of each view controller. Is there any way to get around that? Since the view controllers are just UITableViewControllers with no other outlets, it seems excessive to create a NIB for each tab (which I assume would allow the viewDidLoad to only get called when the user first switches to the tab? Or am I wrong on that?)
Anyway, my question mainly, is: how is it conventionally done? If you have 10 different view controllers on one UITabBarController
, do you put them all in mainwindow.xib? If so, should each have its own NIB, and if not, where do you put them, and how do you add them to the tab bar?