ストーリーボードを使用して新しいタブ付きアプリケーションを生成しました。
これまでのところ私は
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!