<small id='3g5IU'></small><noframes id='3g5IU'>

    1. <tfoot id='3g5IU'></tfoot>
      <i id='3g5IU'><tr id='3g5IU'><dt id='3g5IU'><q id='3g5IU'><span id='3g5IU'><b id='3g5IU'><form id='3g5IU'><ins id='3g5IU'></ins><ul id='3g5IU'></ul><sub id='3g5IU'></sub></form><legend id='3g5IU'></legend><bdo id='3g5IU'><pre id='3g5IU'><center id='3g5IU'></center></pre></bdo></b><th id='3g5IU'></th></span></q></dt></tr></i><div id='3g5IU'><tfoot id='3g5IU'></tfoot><dl id='3g5IU'><fieldset id='3g5IU'></fieldset></dl></div>
          <bdo id='3g5IU'></bdo><ul id='3g5IU'></ul>
        <legend id='3g5IU'><style id='3g5IU'><dir id='3g5IU'><q id='3g5IU'></q></dir></style></legend>

        如何从 navigationController(viewControllers/stack) 弹回指定 viewCon

        How to pop back to specify viewController from navigationController(viewControllers/stack)?(如何从 navigationController(viewControllers/stack) 弹回指定 viewController?)

          <legend id='tcDXY'><style id='tcDXY'><dir id='tcDXY'><q id='tcDXY'></q></dir></style></legend>
          <i id='tcDXY'><tr id='tcDXY'><dt id='tcDXY'><q id='tcDXY'><span id='tcDXY'><b id='tcDXY'><form id='tcDXY'><ins id='tcDXY'></ins><ul id='tcDXY'></ul><sub id='tcDXY'></sub></form><legend id='tcDXY'></legend><bdo id='tcDXY'><pre id='tcDXY'><center id='tcDXY'></center></pre></bdo></b><th id='tcDXY'></th></span></q></dt></tr></i><div id='tcDXY'><tfoot id='tcDXY'></tfoot><dl id='tcDXY'><fieldset id='tcDXY'></fieldset></dl></div>
            • <bdo id='tcDXY'></bdo><ul id='tcDXY'></ul>

                1. <tfoot id='tcDXY'></tfoot>
                    <tbody id='tcDXY'></tbody>
                2. <small id='tcDXY'></small><noframes id='tcDXY'>

                  本文介绍了如何从 navigationController(viewControllers/stack) 弹回指定 viewController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我创建了一个具有串行视图(A、B、C、D、...)的应用程序,我需要将 D 弹回 B.有人可能会说为什么不使用:

                  I've created an application with serial views (A,B,C,D,...), and I need to pop back D to B. Someone may say Why not using:

                  [self.navigationController popToViewController:[[self.navigationController viewControllers] objectAtIndex:1] animated:YES];
                  

                  但是,这不是一个好的解决方案.因为这个方法需要你获取我们的B"所在的索引.

                  However, it is not a good solution. Because this method needs you to get the index which our "B" is store in.

                  问题:如何获取viewControllers中B"的索引?

                  Question: How to get the index of "B" in the viewControllers?

                  UIViewControllers 中的格式应为:
                  "< A: 0x6e70710 >","","< B: 0x6988a70 >","",""

                  format in the UIViewControllers should be:
                  "< A: 0x6e70710 >", "< C: 0x6e30370 >", "< B: 0x6988a70 >", "< D: 0x6ea8950 >", "< E: 0x6eaaad0 >"

                  我尝试过使用 rangeOfStringhasPrefix 来获取B"视图的索引,但失败了.

                  I've tried and failed to use rangeOfString and hasPrefix to get the "B" view's index.

                  推荐答案

                  这里我想知道NavigationController通过Concept Of Stack管理ViewController.ie LAST COME FIRST OUT.这里有两种相同的方法.

                  Here i would like to know you that NavigationController manage the ViewController by the Concept Of Stack.ie LAST COME FIRST OUT.Here are two Approach for doing the Same.

                  1)在这里您可以进行迭代以获得所需的 ViewController,如下所示

                  1)Here you can make iteration for getting the desirable ViewController as Below

                    for (id controller in [self.navigationController viewControllers])
                     {
                     if ([controller isKindOfClass:[BViewController class]])
                    {
                      [self.navigationController popToViewController:controller animated:YES];
                      break;
                    }
                    }
                  

                  2) 这里有 A,B,C,D 控制器.意味着 B 将在第三位,所以你能做什么

                  2) Here you have A,B,C,D Controllers. means B would be on 3rd Position so what can you do

                  您可以将索引硬连线如下

                  you can hard wired the Index as Below

                    [self.navigationController popToViewController:[[self.navigationController viewControllers] objectAtIndex:2] animated:YES];
                  

                  希望对你有所帮助..

                  这篇关于如何从 navigationController(viewControllers/stack) 弹回指定 viewController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                  How to get the previous viewcontroller that pushed my current view(如何获取推送我当前视图的上一个视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)

                        <bdo id='VejhC'></bdo><ul id='VejhC'></ul>

                            <i id='VejhC'><tr id='VejhC'><dt id='VejhC'><q id='VejhC'><span id='VejhC'><b id='VejhC'><form id='VejhC'><ins id='VejhC'></ins><ul id='VejhC'></ul><sub id='VejhC'></sub></form><legend id='VejhC'></legend><bdo id='VejhC'><pre id='VejhC'><center id='VejhC'></center></pre></bdo></b><th id='VejhC'></th></span></q></dt></tr></i><div id='VejhC'><tfoot id='VejhC'></tfoot><dl id='VejhC'><fieldset id='VejhC'></fieldset></dl></div>

                          1. <small id='VejhC'></small><noframes id='VejhC'>

                            <legend id='VejhC'><style id='VejhC'><dir id='VejhC'><q id='VejhC'></q></dir></style></legend>
                            <tfoot id='VejhC'></tfoot>

                              <tbody id='VejhC'></tbody>