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

  • <small id='I2Y8O'></small><noframes id='I2Y8O'>

      • <bdo id='I2Y8O'></bdo><ul id='I2Y8O'></ul>
    1. <tfoot id='I2Y8O'></tfoot>
    2. <legend id='I2Y8O'><style id='I2Y8O'><dir id='I2Y8O'><q id='I2Y8O'></q></dir></style></legend>

        UINavigationController 不弹出 UINavigationBar 项目

        时间:2023-06-12

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

              • <bdo id='i5XRC'></bdo><ul id='i5XRC'></ul>

                    <tbody id='i5XRC'></tbody>

                  <small id='i5XRC'></small><noframes id='i5XRC'>

                • <tfoot id='i5XRC'></tfoot>
                  本文介绍了UINavigationController 不弹出 UINavigationBar 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当 UINavigationController 弹出视图控制器时,我的 UINavigationBar 没有弹出它的项目.

                  I'm having a problem where my UINavigationBar isn't popping it's items when the UINavigationController pops a view controller.

                  我查看了堆栈,观察到以下内容:

                  I have had a look at the stacks observed the following:

                  • 分配的导航控制器的预期数量(在仪器中签入)
                  • 堆栈中有正确数量的控制器.(调试日志记录)
                  • 导航项未弹出.(调试日志记录)

                  这就是我所做的.

                  我在调用 super 后在 viewDidLoad 方法中弹出了一些日志语句.

                  I popped some log statements into the viewDidLoad method after calling super.

                  NSLog(@"%@", [self navigationController]);
                  NSLog(@"%@", [[self navigationController] viewControllers]);
                  NSLog(@"%@", [[self navigationController] navigationBar]);
                  NSLog(@"%@", [[[self navigationController] navigationBar] items]);
                  

                  加载初始视图后.

                  2009-10-09 16:42:51.706 Bob[11657:207] <UINavigationController: 0x243bb0>
                  2009-10-09 16:42:51.720 Bob[11657:207] (
                      <MediaBrowser: 0x2354c0>
                  )
                  2009-10-09 16:42:51.742 Bob[11657:207] <UINavigationBar: 0x243e50; frame = (0 20; 320 44); autoresize = W; layer = <CALayer: 0x243ed0>>
                  2009-10-09 16:42:51.758 Bob[11657:207] (
                      <UINavigationItem: 0x242d60>
                  )
                  

                  一切看起来都不错.推动第二个控制器.

                  All looks good. Push the second controller.

                  2009-10-09 16:43:11.800 Bob[11657:207] -[MediaBrowser beginLoading] [Line 261] 
                  2009-10-09 16:43:12.320 Bob[11657:207] -[MediaBrowser loadingComplete] [Line 269] 
                  2009-10-09 16:43:12.587 Bob[11657:207] <UINavigationController: 0x243bb0>
                  2009-10-09 16:43:12.654 Bob[11657:207] (
                      <MediaBrowser: 0x2354c0>,
                      <MediaBrowser: 0x2c1cc0>
                  )
                  2009-10-09 16:43:12.685 Bob[11657:207] <UINavigationBar: 0x243e50; frame = (0 20; 320 44); autoresize = W; layer = <CALayer: 0x243ed0>>
                  2009-10-09 16:43:12.734 Bob[11657:207] (
                      <UINavigationItem: 0x242d60>,
                      <UINavigationItem: 0x2c63b0>
                  )
                  

                  这里也没有什么意外的.推动第三个控制器.

                  Again nothing unexpected here. Push the third controller.

                  2009-10-09 16:43:19.934 Bob[11657:207] -[MediaBrowser beginLoading] [Line 261] 
                  2009-10-09 16:43:20.388 Bob[11657:207] -[MediaBrowser loadingComplete] [Line 269] 
                  2009-10-09 16:43:20.928 Bob[11657:207] <UINavigationController: 0x243bb0>
                  2009-10-09 16:43:20.962 Bob[11657:207] (
                      <MediaBrowser: 0x2354c0>,
                      <MediaBrowser: 0x2c1cc0>,
                      <MediaBrowser: 0x4027e20>
                  )
                  2009-10-09 16:43:21.003 Bob[11657:207] <UINavigationBar: 0x243e50; frame = (0 20; 320 44); autoresize = W; layer = <CALayer: 0x243ed0>>
                  2009-10-09 16:43:21.039 Bob[11657:207] (
                      <UINavigationItem: 0x242d60>,
                      <UINavigationItem: 0x2c63b0>,
                      <UINavigationItem: 0x4028880>
                  )
                  

                  一切都好.现在让我们弹出一个控制器

                  All good. Now lets pop a controller

                  2009-10-09 16:43:26.935 Bob[11657:207] <UINavigationController: 0x243bb0>
                  2009-10-09 16:43:26.945 Bob[11657:207] (
                      <MediaBrowser: 0x2354c0>,
                      <MediaBrowser: 0x2c1cc0>
                  )
                  2009-10-09 16:43:26.964 Bob[11657:207] <UINavigationBar: 0x243e50; frame = (0 20; 320 44); autoresize = W; layer = <CALayer: 0x243ed0>>
                  2009-10-09 16:43:26.977 Bob[11657:207] (
                      <UINavigationItem: 0x242d60>,
                      <UINavigationItem: 0x2c63b0>,
                      <UINavigationItem: 0x4028880>
                  )
                  

                  嗯.出了点问题.控制器已弹出,但导航项仍然存在.咯咯笑,让我们再推一下.

                  Humm. Something is going amiss. The controller has popped but the navigation item is still there. For giggles lets push again.

                  009-10-09 16:44:05.878 Bob[11657:207] <UINavigationController: 0x243bb0>
                  2009-10-09 16:44:05.908 Bob[11657:207] (
                      <MediaBrowser: 0x2354c0>,
                      <MediaBrowser: 0x2c1cc0>,
                      <MediaBrowser: 0x407eb00>
                  )
                  2009-10-09 16:44:05.951 Bob[11657:207] <UINavigationBar: 0x243e50; frame = (0 20; 320 44); autoresize = W; layer = <CALayer: 0x243ed0>>
                  2009-10-09 16:44:05.996 Bob[11657:207] (
                      <UINavigationItem: 0x242d60>,
                      <UINavigationItem: 0x2c63b0>,
                      <UINavigationItem: 0x4028880>,
                      <UINavigationItem: 0x407f280>
                  )
                  

                  控制器堆栈看起来不错,导航项堆栈有很多麻烦.让我们最后一次弹出.

                  The controller stack looks good, the navigation item stack is in lots of trouble. Lets pop one last time.

                  2009-10-09 16:44:17.770 Bob[11657:207] <UINavigationController: 0x243bb0>
                  2009-10-09 16:44:17.776 Bob[11657:207] (
                      <MediaBrowser: 0x2354c0>,
                      <MediaBrowser: 0x2c1cc0>
                  )
                  2009-10-09 16:44:17.785 Bob[11657:207] <UINavigationBar: 0x243e50; frame = (0 20; 320 44); autoresize = W; layer = <CALayer: 0x243ed0>>
                  2009-10-09 16:44:17.793 Bob[11657:207] (
                      <UINavigationItem: 0x242d60>,
                      <UINavigationItem: 0x2c63b0>,
                      <UINavigationItem: 0x4028880>,
                      <UINavigationItem: 0x407f280>
                  )
                  

                  所以控制器堆栈很好.另一方面,导航项存在一些问题.

                  So the controller stack is fine. Navigation items on the other hand have some issues.

                  我被难住了.我确定我在做一些奇怪/奇怪/错误的事情,但如果我能看到它,我该死.我要做的唯一操作是准备(通过我的控制器 navigationItem 属性)自定义 rightBarItem.

                  I'm stumped. I'm sure I'm doing something odd/weird/wrong but damn me if I can see it.The only manipulation i'm going is preparing (via my controllers navigationItem property) a custom rightBarItem.

                  如果你能做到这一点,谢谢.对我可能从这里去哪里的想法将不胜感激.

                  If you got this far, thanks. Thoughts on where I might go from here would be appreciated.

                  推荐答案

                  搞定了.

                  原来是做了一些愚蠢的事情.

                  So it turns out that I was doing something stupid.

                  我在 NSMutableArray 的内部类别中添加了一个 pop 方法.该方法没有正确弹出.UINavigationBar 还必须向 NSMutableArray 添加一个 pop 方法.我的越野车赢得并打破了 UIBarItem 的流行.

                  I had added a pop method in an internal category to NSMutableArray. That method wasn't popping correctly. UINavigationBar must also add a pop method to NSMutableArray. My buggy one was winning and breaking the pop of the UIBarItem.

                  这篇关于UINavigationController 不弹出 UINavigationBar 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何更改搜索控制器中的 uitextfield 颜色? 下一篇:如何将我的 CustomNavigationBar 分配给 UINavigationController?

                  相关文章

                    • <bdo id='Vf6FH'></bdo><ul id='Vf6FH'></ul>

                    <small id='Vf6FH'></small><noframes id='Vf6FH'>

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

                    <tfoot id='Vf6FH'></tfoot>