嵌套推送动画iOS7的bug? [英] Nested push animations iOS7 bug?

查看:120
本文介绍了嵌套推送动画iOS7的bug?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚遇到一个我测试错误的应用程序的问题。我正在敲打墙头,明白为什么会出现这个错误:

I just encountered a problem with an app I bug-tested. I was banging my head to the wall to understand why I got this error:

2013-11-25 09:02:55.687[186:60b] nested push animation can result in corrupted   navigation bar
2013-11-25 09:02:56.055[186:60b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-11-25 09:02:57.666[186:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't add self as subview'

一段时间后我创建了一个新项目试图重现该错误:

After a while i created a new project to try to reproduce the bug:

当我按下具有不同segue的两个条形按钮项目,然后同时释放时,会发生这种情况。我正在使用带有segues的故事板,并且没有任何自编代码。这是一个iOS7错误,还是我错过了什么?

This happends when I press down on two bar button items with different segues, and then release at the same time. I'm using story boards with segues and have NO self written code whatsoever. Is this an iOS7 bug, or am I missing something?

我无法在模拟器上重现,因为我没有两个游标......我是使用带iOS7 7.0.3的iPad2

I have not been able to reproduce on simulator, since I don't have two cursors... I am using an iPad2 with iOS7 7.0.3

故事板图片:

编辑:

由于我被粉碎并完全没有投票,甚至没有人试图重现并确认这个错误,我已经在没有确认的情况下报告了它。

Since I got smashed and totally downvoted without noone even trying to reproduce and confirm this bug, I've reported it without confirmation.

EDIT2:

Apple要求堆栈跟踪。但既然我给了他们重现的确切步骤,我没有打扰。这不是我的工作。所以随时报告这个。

Apple asked for a Stack trace. But since I gave them the exact steps to reproduce, I didn't bother. It's not my job. So feel free to report this.

推荐答案

我刚刚实现了类似的东西,它现在正在运作。

I've just implemented something like that and it is now working.

所以我有视图控制器A,B& C.通常用户可以从A导航到B,从B导航到C,但现在我创建了一种用户可以自动从A导航到C(到B)的方式。

So I have view controllers A, B & C. Normally users can navigate from A to B and from B to C but now I created a way that users can navigate from A to C (through B) automatically.

我所做的是在B中创建一个公共方法来推C。这个方法看起来像:

What I did was to create a public method in B saying to push C. This method looks like:

- (void)pushC {
    if ([self isViewLoaded] && self.navigationController.visibleViewController == self && ![self isBeingPresented] && self.didViewAppear) {
        [self performSegueWithIdentifier:@"CSegue" sender:self];
    }
    else {
        [self performSelector:@selector(pushC) withObject:nil afterDelay:0.4f];
    }
}

除了<$>之外,一切都已经给你了c $ c> didViewAppear 属性。那个我在上设置为true - viewDidAppear

然后我只需要调用 - 在视图控制器A中的 - prepareForSegue 方法上的pushC 。正如我们所见,他将等待合适的时间实际调用下一个segue。

Then I only need to call - pushC on the - prepareForSegue method in view controller A. As we've seen, he will wait for the right time to actually call the next segue.

这项工作正常,但显示了我不需要的所有导航过渡。我宁愿能够将一棵树推入导航控制器,所以我只有一个过渡导航。好吧,我想我以后必须回到这件事。

This works alright but shows all the navigation transitions, which I don't need. I would prefer to be able to push a tree into the navigation controller so I would have only one transition navigation. Well, I guess I'll have to come back to this thing later.

这就是说我不认为这是一个bug但实际上是iOS7中的行为改变了因为动画变得更长了。

This being said I don't think it's a bug but actually a change in behaviour in iOS7 because the animation got longer.

这篇关于嵌套推送动画iOS7的bug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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