performSegueWithIdentifier和popViewControllerAnimated打破屏幕导航

时间:2013-09-20 12:13:53

标签: iphone ios uinavigationcontroller uistoryboardsegue

我有4个ViewControllers A,B,C,D。我使用从Storyboard创建的Push Segues从A-> B-> C-> D移动。

由于我的应用程序的逻辑,如果用户想要从屏幕D返回,屏幕C不再有效,我使用performSegueWithIdentifier

将用户重定向到屏幕C.

问题现在开始了 - 我无法使用[self.navigationController popViewControllerAnimated:YES];

从屏幕B-> A回来

我想知道为什么会发生这种情况,我该如何处理这种情况?修复导航?

1 个答案:

答案 0 :(得分:1)

您使用的segue类型是什么?

你为什么不用:

- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated

您可以使用viewControllers的{​​{1}}属性访问视图控制器堆栈。

这是Apple's documentation on UINavigationController