【发布时间】:2013-05-25 09:13:59
【问题描述】:
从主视图 - 我的 RootViewController - 随着用户在导航层次结构中的进展,我一个接一个地打开 2 个 ViewController,如下所示:
1) SecondViewController 由我的 Storyboard 中连接的按钮推动
2) ThirdViewController 模态呈现
[self performSegueWithIdentifier:@"NextViewController" sender:nil];
所以,图片是:RootViewController -> SecondViewController -> ThirdViewController
现在在我的 ThirdViewController 中,我希望有一个按钮可以返回 2 次到我的 RootViewController,即回家。但这不起作用:
[self.navigationController popToRootViewControllerAnimated:YES];
只有这家伙回到 SecondViewController 一次
[self.navigationController popViewControllerAnimated:YES];
如何同时删除模态和推送视图控制器?
【问题讨论】:
-
我认为你想做的是在你的thirdViewController:[self.presentingViewControllerdismissViewControllerAnimated:NO]; [self.presentingViewController popToRootViewControllerAnimated:YES];,请原谅我在手机上打字不好
-
Return to root view in IOS 的可能重复项
标签: ios objective-c uiviewcontroller uinavigationcontroller storyboard