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

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

      iOS:popViewController 意外行为

      时间:2023-05-17
      <tfoot id='lGYaM'></tfoot>
        <bdo id='lGYaM'></bdo><ul id='lGYaM'></ul>

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

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

          <legend id='lGYaM'><style id='lGYaM'><dir id='lGYaM'><q id='lGYaM'></q></dir></style></legend>

                <tbody id='lGYaM'></tbody>

                本文介绍了iOS:popViewController 意外行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我一直在互联网上寻找解决方案.我找不到任何东西.所以:我正在使用 UINavigationController.我将两个 UIViewControllers 推到它上面.在第二个推送的 ViewController 中,我正在执行此代码:

                I've been searching the internet for a solution. There's nothing I could find. So: I'm using a UINavigationController. I am pushing two UIViewControllers onto it. In the second pushed ViewController i am executing this code:

                - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error {
                NSLog([error localizedDescription]);
                [self.navigationController popViewControllerAnimated:YES]; }
                

                预期发生的事情是最后推送的 ViewController 消失了.在这个应用程序中,我在几个地方执行此操作,并且在这个 ViewController 中可以正常工作.发生的情况是只有后退按钮离开屏幕(动画),但其他一切都留在屏幕上.在控制台输出中,执行此行时会打印出两件事:

                The expected thing to happen would be that the last pushed ViewController disappears. In this app I am doing this on few places and it works fine everywhere expect in this very ViewController. What happens is that only the back button goes off screen (animated) but everything else stays on screen. In the Console Output two things are printed out when this line executes:

                2011-03-14 16:32:44.580TheAppXY[18518:207] 嵌套弹出动画可能导致损坏导航栏

                2011-03-14 16:32:44.580 TheAppXY[18518:207] nested pop animation can result in corrupted navigation bar

                2011-03-14 16:32:53.507TheAppXY[18518:207] 完成一个意外的导航过渡状态.导航栏子视图树可能会损坏.

                2011-03-14 16:32:53.507 TheAppXY[18518:207] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

                我找不到任何信息的两条错误消息.我正在使用 XCode 4 和 iOS SDK 4.3.也许任何人都可以帮助我解决这个问题.

                Two error messages I couldn't find ANY information on. I'm using XCode 4 and iOS SDK 4.3. Maybe anyone can help me with this problem.

                推荐答案

                在我的代码中遇到了类似的情况,消息说:

                I came across a similar situation in my code and the message said:

                嵌套推送动画会导致导航栏损坏

                nested push animation can result in corrupted navigation bar

                在意外状态下完成导航转换.导航栏子视图树 >可能会损坏.

                Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree >might get corrupted.

                我对这个问题的发现是我正在快速连续地一个接一个地推动 2 个视图控制器,并且两个都是动画的.

                My finding to this issue was that I was pushing 2 view controllers one after the other in quick succession and both were animated.

                在您的情况下,您可能会一个接一个地弹出多个带有动画的视图控制器.

                In your case it seems that you might be popping multiple view controllers with animation one after the other.

                因此,当一个视图正在播放动画时,您不应该在另一个视图上开始动画.

                Hence, while one view is undergoing animation you should not start animation on another view.

                我还发现,如果我在一个视图上禁用动画,错误消息就会消失.

                I also found that if I disabled animation on one view, the error message disappeared.

                就我而言,这是流程逻辑的问题,因为我不打算一个接一个地推送 2 个视图控制器.一个在 switch case 逻辑中被推动,另一个在其结束后被推动.

                In my case it was a problem with the flow logic as I did not intend to push 2 view controllers one after the other. One was being pushed within the switch case logic and another after its end.

                希望这对某人有所帮助.

                Hope this helps someone.

                这篇关于iOS:popViewController 意外行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:iOS 11 navigationItem.titleView 宽度未设置 下一篇:当我从导航控制器推送时如何隐藏导航栏?

                相关文章

                <legend id='IMPiu'><style id='IMPiu'><dir id='IMPiu'><q id='IMPiu'></q></dir></style></legend>

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

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

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