2011-04-19 15 views
0

こんにちはゲスト私はウィンドウとタブバーを持っています。すべてのビューコントローラをタブバーとウィンドウに追加するにはどうすればいいですか?私のコードはここにウィンドウにUITabBarControllerを追加する方法

UITabBarController *tab = [[UITabBarController alloc] init]; 

UIViewController *first = [[UIViewController alloc] init]; 
UIViewController *second = [[UIViewController alloc] init]; 
UIViewController *third = [[UIViewController alloc] init]; 

//HOW can i add these view controllers to tabbar and hwo to add tabbar to window... 


[self.window makeKeyandVisible]; 

です..私はここに新しいですが、私はこれが動作すると思いますおかげ

答えて

0

を助けてください。そこにはたくさんのツタがあるので、それらをチェックしたいかもしれません。私ができるならあなたのために1つを見つけることを試みるが、これは十分であると思う。

UITabBarController *tab = [[UITabBarController alloc] init]; 

UIViewController *first = [[UIViewController alloc] init]; 
UIViewController *second = [[UIViewController alloc] init]; 
UIViewController *third = [[UIViewController alloc] init]; 

NSArray *tt = [[NSArray alloc] initWithObjects:first, second, third, nil]; 

tab.viewControllers = [[NSArray alloc] initWithArray:tt]; 

[self.window addSubview:[tab view]]; 
[self.window makeKeyAndVisible]; 
関連する問題