當我在iPhone 6.0模擬器中運行我的應用程序,它顯示預計將有一個根視圖iPhone 6.0模擬器:應用程序窗口預計將有在應用程序啓動的最後一個根視圖控制器
應用程序窗口控制器在應用程序啓動結束時
在其他模擬器中它不存在。爲什麼? 這個錯誤是什麼意思?
我的應用程序的導航流程如下:首先,我的應用程序應顯示登錄屏幕。進入應用程序後,我需要用tabbar顯示一個視圖。在這個視圖中有很多按鈕會在那裏,當我們點擊這些按鈕時,它應該顯示沒有tabbar的相應視圖控制器。這就是爲什麼我將這些導航控制器添加到窗口。
這裏是我的didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.tabBarController = [[UITabBarController alloc] init];
self.window.rootViewController = self.tabBarController;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor=[UIColor blackColor];
[application setStatusBarStyle:UIStatusBarStyleBlackOpaque];
Object1 = [[Class1 alloc] initWithNibName:@"Class1" bundle:nil];
tempNav=[[UINavigationController alloc]initWithRootViewController:Object1];
tempNav.navigationBar.hidden=YES;
tempNav.view.frame = CGRectMake(0.0f, 20.0f, 320.0f, 460.0f);
self.window addSubview:tempNav.view];
LoginObj = [[Login alloc] initWithNibName:@"Login" bundle:nil];
navController=[[UINavigationController alloc]initWithRootViewController:LoginObj];
navController.navigationBar.hidden=YES;
navController.view.frame = CGRectMake(0.0f, 20.0f, 320.0f, 460.0f);
[self.window addSubview:navController.view];
Obj2 = [[Class2 alloc] initWithNibName:@"Class2" bundle:nil];
navController1=[[UINavigationController alloc]initWithRootViewController:Obj2];
navController1.navigationBar.hidden=YES;
navController1.view.frame = CGRectMake(0.0f, 20.0f, 320.0f, 460.0f);
[self.window addSubview:navController1.view];
Obj3 = [[Class3 alloc] initWithNibName:@"Class3" bundle:nil];
navController2=[[UINavigationController alloc]initWithRootViewController:Obj3];
navController2.navigationBar.hidden=YES;
navController2.view.frame = CGRectMake(0.0f, 20.0f, 320.0f, 460.0f);
[self.window addSubview:navController2.view];
Obj4 = [[Class4 alloc] initWithNibName:@"Class4" bundle:nil];
navController3=[[UINavigationController alloc]initWithRootViewController:Obj4];
navController3.navigationBar.hidden=YES;
navController3.view.frame = CGRectMake(0.0f, 20.0f, 320.0f, 460.0f);
[self.window addSubview:navController3.view];
[self.window makeKeyAndVisible];
return YES;
}
你可以包含你的應用程序:didFinishLaunchingWithOptions代碼。這可能是發生這種情況的地方。 – Fogmeister
這表明對我所有的仿真,它發生在你把你的RootViewController的的視圖窗口,而不是設置RootViewController的屬性 – wattson12