从主视图 - 我的 RootViewController - 随着用户在导航层次结构中的进展,我一个接一个地打开 2 个 ViewController,如下所示:
1) SecondViewController 由我的故事板中连接的按钮推动
2) ThirdViewController 以模态方式呈现
[self performSegueWithIdentifier:@"NextViewController" sender:nil];
所以,图片是:RootViewController -> SecondViewController -> ThirdViewController
现在在我的ThirdViewController 中,我想要一个按钮可以返回2 次到我的RootViewController,即回家。但这不起作用:
[self.navigationController popToRootViewControllerAnimated:YES];
只有这个人回到 SecondViewController 一次
[self.navigationController popViewControllerAnimated:YES];
如何同时删除模态和推送视图控制器?