在我的应用程序中,我使用当前的UIModalViewController
启动一个屏幕,并且在该屏幕上我有一个UIButton
,如果我们单击该UIButton
警报将出现,然后在警报 View 上选择是,现在我们必须使用 pushviewcontroller
调用另一个 View 。但是如果我们使用下面的代码,屏幕不会出现,任何人都可以帮助我。
[self.navigationController pushViewController:requestViewController animated:YES];
最佳答案
尝试使用一个根导航 Controller ,然后按如下方式呈现您的 Controller :
FirstViewController *firstView=[[FirstViewController alloc]init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:firstView];
[self presentViewController:navigationController animated:YES completion:nil];
然后推送另一个 View 如下:
SecondViewController *secondView=[[SecondViewController alloc]init];
[self.navigationController pushViewController:secondView animated:YES];
它将首先使用当前模态 viewController 工作,然后使用推送导航 viewControllers 到堆栈上。
关于ios - 无法从 ios 中的当前 View Controller 调用导航 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30317998/