2010-03-28 52 views
0

我想在我的主窗口中使用UITabController作为可能的控制器,并添加导航控制器到一些标签栏项目。TabController内导航

例如,第一个标签具有表视图导航控制器:

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 

在我SettingsViewController.xib文件,通过IB,我挂出口myTableView到厦门国际银行的文件所有者,即SettingViewController类:

alt text http://www.freeimagehosting.net/uploads/e577d35137.png

问题是在主要的xib文件中,对于SettingsViewController导航,有一个出口myTableView。我不确定是否必须将此设置到某处?

我得到的异常是“[UIViewController _loadViewFromNibNamed:bundle:]加载了”SettingsViewController“笔尖,但未设置视图插口。”

+0

我想我是。我用更多的代码和SettingsViewController.xib的快照更新了我的问题。 – 2010-03-29 02:16:51

回答

0

SettingsViewController已具有view属性。你确定这个插件是在Interface Builder中连接的吗? (你可能希望它被连接到你的UITableView。)