2012-04-19 9 views

答えて

4

まず、あなたのルートビューコントローラを宣言し、.mファイル内のナビゲーションコントローラに追加

@property (strong, nonatomic) UITabBarController *tabBarController; 

ファイル.Hデリゲートであなたのタブバーコントローラを宣言

UIViewController *homeViewController = [[[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil] autorelease]; 
    UINavigationController *navigationcontroller = [[[UINavigationController alloc] initWithRootViewController:homeViewController] autorelease]; 

次に、コントローラの配列をタブバーに追加します

self.tabBarController = [[[UITabBarController alloc] init] autorelease]; 
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationcontroller,secondViewController and so on, nil]; 
関連する問題