2012-08-01 72 views

回答

0

至於根據的Xcode 4.3.3當我們創建選項卡式應用程序則給出了兩個視圖控制器。所以,如果你想添加更多,你可以去在AppDelegate中,你可以看到

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions(NSDictionary *)launchOptions 
{ 
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 
// Override point for customization after application launch. 
UIViewController *viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil] autorelease]; 
UIViewController *viewController2 = [[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil] autorelease]; 
self.tabBarController = [[[UITabBarController alloc] init] autorelease]; 
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil]; 
self.window.rootViewController = self.tabBarController; 
[self.window makeKeyAndVisible]; 
return YES; 
} 

而且你可以看到兩個視圖控制器在tabBarController相加,您可以創建新的,併爲1或2,加入添加初始化。 試試.......

0

這裏是一個視頻,我相信會解決您的答案:here

但「最好的」可有時主觀的東西。無論是使用「故事板」你的優勢還是去由貝瑞M.

描述的代碼路徑