2011-05-20 7 views
0

こんにちは友人、私は質問がある、これは同じアプリで2つの異なるタブバークラスを使用することは可能ですか? 私のアプリに2つのタブバーコントローラがあることを意味します。 Like 1stはnewtabcontroller.hです& newtabcontroller.m 2nd is oldtabcontroller.h & oldtabcontroller.m アプリ内で2つの異なるtabbarcontrollerを使用することができます。 ありがとうiphoneのtabBarコントローラーについて

+0

これは、http://stackoverflow.com/questions/1907483/multiple-tab-bar-controllerとその他のもののようです。 – CharlieMezak

答えて

0

なぜですか? しかし、別のtabbarcontrollerの中のtabbarcontrollerであってはなりません。

TabbarManagerクラスを持っています。その後、いくつかの条件で、負荷 - FirstTabbarControllerまたは - SecondTabbarController

すべてのコンポーネント自体はTabbarManagerクラスでインスタンス化されなければならないUITabbarControllers。 initにはこのようなコードがありますが、2つのtabbarcontrollersと似ています。

self.tabBarController = [[UITabBarController alloc] init]; 
    self.controllers = [[NSMutableArray alloc] init]; 

// initialize the view controllers and navigation controllers for the tab bar 

self.friendsVC = [[FriendsVC alloc] initWithNibName:@"FriendsView" bundle:nil]; 
UINavigationController *friendsNVC = [[UINavigationController alloc] initWithRootViewController: friendsVC]; 
friendsNVC.navigationBar.barStyle = UIBarStyleBlack; 
[controllers addObject:friendsNVC]; 
[friendsNVC release]; 

self.paymentsVC = [[PaymentsVC alloc] initWithNibName:@"PaymentsView" bundle:nil]; 
UINavigationController *paymentsNVC = [[UINavigationController alloc] initWithRootViewController: paymentsVC]; 
paymentsNVC.navigationBar.barStyle = UIBarStyleBlack; 
[controllers addObject:paymentsNVC]; 
[paymentsNVC release]; 

tabBarController.viewControllers = controllers; 
tabBarController.selectedIndex = 0; 
tabBarController.delegate = self; 

self.view = tabBarController.view; 
関連する問題