0
我已經使用故事板生成了一個新的選項卡式應用程序。從UITabBarController提供模態視圖
到目前爲止,我有
TabBarController - > FirstViewController - > SecondViewController - > ModalViewController
我試圖顯示tabBarController之前打開模式的看法。我加的AppDelegate.m下面的代碼
showModalView
被稱爲從application:didFinishLaunchingWithOptions:;
- (void)showModalView
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
GSLoginViewController *loginView = [storyboard instantiateViewControllerWithIdentifier:@"loginView"];
[loginView setModalPresentationStyle:UIModalPresentationFullScreen];
[self.window.rootViewController presentViewController:loginView animated:YES completion:NULL];
}
這裏的輸出我:
Warning: Attempt to present <ModalViewController: 0x93670d0> on
<UITabBarController: 0x935d170> whose view is not in the window hierarchy!
你可以在[這裏] [1]找到答案。 [1]:http://stackoverflow.com/questions/11862883/whose-view-is-not-in-the-window-hierarchy –