UITabbar +導航應用程序。我的模式controllerNav沒有出現在屏幕上。哪裏不對?我的模態視圖控制器沒有出現在屏幕上。 UITabbar +導航應用程序
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.rootViewController = self.tabBarController;
if (isLoginScreenNeeded)
{
LoginModalViewController *controller = [[[LoginModalViewController alloc] initWithNibName:@"LoginModal" bundle:[NSBundle mainBundle]] autorelease];
UINavigationController *controllerNav = [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
[self.window.rootViewController presentModalViewController:controllerNav animated:NO];
}
[self.window makeKeyAndVisible];
return YES;
}
編輯:@Zoleas,我更新了我的代碼。如果我將刪除[self.window makeKeyAndVisible]; - 有用。但我不明白爲什麼我需要刪除self.window makeKeyAndVisible];
我刪除了parentViewController,但它沒有幫助我。 – Voloda2
你確定所有的控制器都不是零嗎?在嘗試呈現你的modalViewController之前,你能記錄self.tabBarController,controller和controllerNav嗎? – Zoleas