Application windows are expected to have a root view controller at the end of application launch 的解决
2013-08-21 14:33
471 查看
原因:出现的原因一般是运行时未给 self.window的 rootViewController的对象分配内存造成的,如下面类似例子
NSArray *item = [NSArray arrayWithObjects:nc1, nil]; _tabBar.tabBar.backgroundImage = [UIImage imageNamed:@"tabbarbg_app.png"]; [_tabBar setDelegate:self]; [_tabBar setViewControllers:item]; _tabBar.selectedIndex = 0; [self.window setRootViewController:_tabBar]; [self.window setBackgroundColor:[UIColor whiteColor]];
解决方法: 为_tabBar添加内存分配即可
NSArray *item = [NSArray arrayWithObjects:nc1, nil]; _tabBar = [[UITabBarController alloc] init]; _tabBar.tabBar.backgroundImage = [UIImage imageNamed:@"tabbarbg_app.png"]; [_tabBar setDelegate:self]; [_tabBar setViewControllers:item]; _tabBar.selectedIndex = 0; [self.window setRootViewController:_tabBar]; [self.window setBackgroundColor:[UIColor whiteColor]];
相关文章推荐
- 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 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.
- Applications are expected to have a root view controller at the end of application launch
- iOS每次启动都提示:Application windows are expected to have a root view controller at the end of application
- ios6.0之后单个屏幕旋转,不用根视图以及Application windows are expected to have a root view controller at the end of