I am trying to use UITabController as may controller in my main window and add navigation controllers to some tab bar items.
For example, the first tab has a navigation controller with table view:
The SettingsViewController is associated with its own NIB file, where a table view is defined. Within that xib file, I have a table view and set it to the outlet of SettingsViewController class property myTableView.
Here are my h files:
// header file for SettingViewController class
@interface SettingsViewController :
UIViewController <UITableViewDelegate, UITableViewDataSource> {
UITableView *myTableView;
// other codes vars
}
@property (nonatomic, retain) IBOutlet UITableView *myTableView;
// ...
@end
// header for main app delegate
@interface MainAppDelegate :
NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
UIWindow *window;
UITabBarController *tabBarController;
// ...
}
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
// ...
@end
In my SettingsViewController.xib file, through IB, I linked outlet myTableView to the xib's file owner, ie, SettingViewController class:
The problem is that in the main xib file, for the SettingsViewController navigation, there is one outlet myTableView. I am not sure if I have to set this to somewhere?
The exception I get is "[UIViewController _loadViewFromNibNamed:bundle:] loaded the "SettingsViewController" nib but the view outlet was not set."