我正在尝试使用UITabController作为主窗口中的may控制器,并将导航控制器添加到某些选项卡栏项中。
例如,第一个选项卡有一个带有表视图的导航控制器:
alt text http://www.freeimagehosting.net/uploads/f3ad987c86.png
SettingsViewController与其自己的NIB文件相关联,其中定义了表视图。在该xib文件中,我有一个表视图,并将其设置为SettingsViewController类属性myTableView的出口。
以下是我的h文件:
// 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
alt text http://www.freeimagehosting.net/uploads/e577d35137.png
问题是在主xib文件中,对于SettingsViewController导航,有一个outlet myTableView。我不确定我是否必须把它设置到某个地方?