- (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;
}
- アプリに(新規ファイル]> [空のインタフェースビルダー文書)、その後は、あなたが「メインnibファイルのベース名」と呼ばれるキーを追加し、それはだ設定できるのInfo.plist値を "MainWindow"に設定します。
アプリケーションデリゲートで、ウィンドウとUINavigationControllerをIBOutletsとして設定し、それらを生成するコードを削除します。次に、MainWindow.xibファイルに、アプリケーションデリゲート、UINavigationController、およびWindowのインスタンスを追加します。 UINavigationControllerとWindowをデリゲートのアウトレットに接続します。
こんにちは、両方の答えは右です。私は今のところコードルートで行くつもりです。 –