コンソールに次のエラーが表示されます:
アプリケーションは、起動の最後にルートビューコントローラを持つことが期待されます。
以下が私の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];