iphone - 如何从导航堆栈中的任何位置弹出到任意 View Controller

标签 iphone uinavigationcontroller ios

我正在开发一个基于导航的应用程序,我选择它是为了可以在堆栈上推送和弹出 Controller 。继续前进很容易——只需推一个新的 Controller 。只要转到 Root View Controller ,返回就很容易。有一个名为 popToViewController:animated, 的方法,但我没有在我当前的 View Controller 中创建我想要弹出的 Controller ,所以编译器提示我没有声明它。我知道它是堆栈上的第二个 Controller (根之上的一个)。我可以用它到达那里吗?

最佳答案

UINavigationController 的 viewControllers 属性具有 viewControllers,以便它们被推送,因此您可以使用它以及您对弹出到该 View Controller 的 View Controller 的了解。这里是引用 UINavigationController ref

关于iphone - 如何从导航堆栈中的任何位置弹出到任意 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3781228/

相关文章:

ios - Swift:如何从 firebase 加载用户并跳过另一个 child 的喜欢的用户

ios - BLE特性通知属性的本质是什么?

ios - 关于 initWithNavigationBarClass 的困惑——如何使用(新的 instanceType 方法)

ios - AVCaptureDevice.requestAccess 使用 UINavigationController 呈现意外行为

objective-c - 我的 admob 横幅显示在顶部

iphone - 您如何检查 uiview 何时出现在屏幕上/完成绘图?

swift - Swift 中获取导航栏项目按钮的位置

iphone:不调用 didReceiveAuthenticationChallenge 和 canAuthenticateAgainstProtectionSpace 以提供安全的 Restful 服务

iphone - 如何更新我的 iPhone 应用程序的应用程序图标?

iphone - 登录FB后如何发帖到墙