これはXcode3では非常に簡単でした。しかしXcode4では完全に失われました。*IBはまったく使用されていないようです。そして、すべてのTabBarControllerコードはコード内にあります。
質問:TabBarControllerテンプレートを使用するときにXcodeが生成するデフォルトコードにNavigationBarControllerを追加するにはどうすればよいですか?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}