アプリケーションは、起動の最後にルートビューコントローラを持つことが期待されます。質問する

アプリケーションは、起動の最後にルートビューコントローラを持つことが期待されます。質問する

コンソールに次のエラーが表示されます:

アプリケーションは、起動の最後にルートビューコントローラを持つことが期待されます。

以下が私のapplication:didFinishLaunchWithOptions方法です:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    // Set Background Color/Pattern
    self.window.backgroundColor = [UIColor blackColor];
    self.tabBarController.tabBar.backgroundColor = [UIColor clearColor];
    //self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"testbg.png"]];

    // Set StatusBar Color
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

    // Add the tab bar controller's current view as a subview of the window
    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];
    return YES;
}

Interface Builder では、UITabBarControllerのデリゲートが App Delegate に接続されます。

この問題を解決する方法を誰か知っていますか?

ベストアンサー1

AppDelegate で置換

 [window addSubview:[someController view]];

  [self.window setRootViewController:someController];

おすすめ記事