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

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

问题描述

我是 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到detail的VC(segue从prototype cell开始,到detail 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.

如果您转到 Storyboard 并单击 segue,您应该能够看到它的起点和终点.它的起源是整个视图控制器还是按钮?如果源是整个视图控制器,您只需要手动 performSegue.您可以尝试注释掉您的 [self performSegueWithIdentifier:@"toMoreDetail" sender: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天全站免登陆