2012-08-01 74 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.

描述的代码路径