objective-c - 如何 'pop' 到不在堆栈上的 View Controller

标签 objective-c ios xcode4

我有一个导航 Controller (带有 Storyboard 和 ARC 的 XCode4),其中一个 segue 连接到每个单独的 ViewController(其中 7 个)。通常,我点击导航 Controller 中的一行,将我带到正确的场景。但是,有时我想使用 segues 从场景“A”到场景“C”,然后从“C”到“B”,它没有通过导航 Controller 放置在堆栈上。

这是否可能(从场景“C”到场景“B”)?

更新:这是将 Controller 放入堆栈的代码:

EnterDataViewController *edvc = [[EnterDataViewController alloc]init];

NSMutableArray *ma = self.navigationController.viewControllers;
[ma insertObject:edvc atIndex:1];
self.navigationController.viewControllers = ma;
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex: 1] animated:YES];

最佳答案

将新的 View Controller 插入到层次结构顶部的下方,并关闭动画。然后,弹出。 :)

关于objective-c - 如何 'pop' 到不在堆栈上的 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10340706/

相关文章:

objective-c - 从 Objective C 中的文件读取

ios - UITableViewCell 有很多 subview 或单个 View

ios - Firebase 查询错误处理

ios - NSURL :initWithString fails for string obtained from NSSearchPathForDirectoriesInDomains

xcode - “initial position” 在 Xcode 的 nib 编辑器中起什么作用?

c++ - xcode 5.1.1 提示 : ISO C++11 does not allow access declarations

ios - 拖动 uiview iOS

objective-c - 使用 root 权限部署应用程序

ios - Firebase + auth0 身份验证

ios - react native : Keyboard dismiss when changing focus in ScrollView