关于Application windows are expected to have a root view controller at the end of application launch
2013-01-09 23:51
501 查看
Application windows are expected to have a root view controller at the end of application launch这个问题在新版xcode和iOS6中出现,一些iOS5的经典著作的例子可能会有这种警告,解决的办法是添加一句 [self.window setRootViewController: rootController];很显然你的AppDelegate肯定需要一个rootViewController。下面是一个来自小橘子的例子。
参考例子:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
[[NSBundle mainBundle] loadNibNamed:@"TabBarController" owner:self options:nil];
[self.window setRootViewController: rootController];//fix the warning in ios6
[self.window addSubview:rootController.view];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
相关文章推荐
- Application windows are expected to have a root view controller at the end of application launch问题分析
- Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of application launch解决方法
- Application windows are expected to have a root view controller at the end of application launch
- Application windows are expected to have a root view controller at the end of application launch 的解决
- 'Application windows are expected to have a root view controller at the end of application launch' [
- “Application windows are expected to have a root view controller at the end of application launch”
- Application windows are expected to have a root view controller at the end of appliaction launch.
- Application windows are expected to have a root view controller at the end of application launch
- Application windows are expected to have a root view controller at the end of application launch
- 'Application windows are expected to have a root view controller at the end of application launch'
- Application windows are expected to have a root view controller at the end of appliaction launch.
- Application windows are expected to have a root view controller at the end of application launch
- Application windows are expected to have a root view controller at the end of application launch
- Applications are expected to have a root view controller at the end of application launch
- iOS 9出现错误Applications are expected to have a root view controller at the end of application launch
- 在写引导页面时,出现Application windows are expected to have a root view controller at the end of application