从导航控制器弹出多个视图 [英] Popping multiple views from the navigation controller

查看:90
本文介绍了从导航控制器弹出多个视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,其rootview是4个tableviews的菜单,用户通过选择加载另一个子视图的单元格来设置搜索查询,因此基本结构如下所示

I have an application which its rootview is a menu to 4 tableviews that the user uses to set up a search query by selecting a cell that loads another subview, so the basic structure looks like this

Root View
- Parent View (search view)
--Sub View (user selects variables here to fill search parameters of the parent view

但是其中一个父视图搜索参数要求将另一个子视图推送到导航堆栈上,以便它看起来像

But one of the Parent View search parameters requiers another sub view to be pushed onto the navigation stack so it would look like

Root View
- Parent View (search view)
--Sub View (user selects variables here to fill search parameters of the parent view
---Sub View (related values to the previous subview i.e. Model / sub model)

我想知道是否有办法从这个子视图回弹到父视图..
我知道你可以弹出一个视图或弹回to rootview但是在这个场合我想要弹出两个子视图这可能吗?

I would like to know if there is a way to pop back to the Parent View from this Sub View.. I know you can pop a single view or pop back to rootview but on this occasion I want to pop two subviews... is this possible?

推荐答案

UINavigationViewController

popToViewController:animated:

弹出视图控制器,直到指定的视图控制器位于导航堆栈的顶部。

Pops view controllers until the specified view controller is at the top of the navigation stack.

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

这篇关于从导航控制器弹出多个视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆