嵌套推送动画可能导致导航栏多次警告损坏 [英] nested push animation can result in corrupted navigation bar multiple warning

查看:89
本文介绍了嵌套推送动画可能导致导航栏多次警告损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ios应用程序开发的新手,我遇到了多个警告的麻烦。

I'm new in ios app developping and i'm having some trouble with multiple warnings.

我有一个加载表视图的导航控制器。
从该表视图中,单击一个单元格会推送一个新的VC(基本上是单元格的细节)。
在那个detailView上,当按下某个按钮时,会推送另一个VC。

I have a Navigation Controller that load a table view. From that table view one touch on a cell pushes a new VC (basically, the detail of the cell). And on that "detailView", when a certain button is pushed, another VC is pushed.

我使用以下代码推送最后一个VC:

I push the last VC with the following code :

- (IBAction)toMoreDetail:(id)sender 
{
    [self performSegueWithIdentifier:@"toMoreDetail" sender:self];
}

当我这样做时,会弹出2条警告:

And when i do that, 2 warnings are poping :

2012-08-05 02:25:41.842 appName[2145:f803] nested push animation can result in corrupted navigation bar
2012-08-05 02:25:42.197 appName[2145:f803] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

到目前为止,我没有找到任何好的答案。
也许任何人都可以帮我解决这个问题。

I didn't find any good answer so far. Maybe anyone can help me with this problem.

谢谢:)

编辑:这里是另一个segue的代码:

Edit : here is the code for the other segue :

从TableList到VC的详细信息(segue从原型单元格开始,然后转到详细的vc):

From the TableList to the VC of detail (the segue start from the prototype cell and goes to the detail vc) :

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"toDetailEvent"])
    {
        NSInteger selectedIndex = [[self.tableView indexPathForSelectedRow] row];
        DetailEvent* detailEvent = [segue destinationViewController];
        detailEvent.eventToDisplay = [listEvents objectAtIndex:selectedIndex];
    }
} 


推荐答案

我的猜测你的按钮是否与segue相关联,所以当你在它上面添加 IBAction 时,你会触发两次segue。

My guess would be your button is linked with the segue, so when you add an IBAction on it, you trigger the segue twice.

如果您转到故事板并单击segue,您应该能够看到它的来源和目的地。它的起源是整个视图控制器还是只是按钮?如果原点是整个视图控制器,则只需手动 performSegue 。你可以尝试注释掉你的 [self performSegueWithIdentifier:@toMoreDetailsender:self]; 东西,看看它是否有效?

If you go to your Storyboard and click on the segue, you should be able to see its origin and destination. Is its origin the entire view controller or just the button? You only need to manually performSegue if the origin is the entire view controller. Can you try comment out your [self performSegueWithIdentifier:@"toMoreDetail" sender:self]; stuff to see if it will work?

这篇关于嵌套推送动画可能导致导航栏多次警告损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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