嵌套的推动animation可能会导致导航栏多次警告

我是新的iOS应用程序开发,我有一些麻烦,多个警告。

我有一个导航控制器,加载一个表视图。 从该表中查看一个单元格上的一个触摸推新的VC(基本上,细胞的细节)。 在“detailView”上,当某个button被按下时,另一个VC被按下。

我用下面的代码推动最后一个VC:

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

当我这样做,2个警告正在popup:

 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. 

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

谢谢 :)

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

从TableList到VC的详细信息(从原型单元格开始,转到细节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]; } } 

我的猜测是你的button与segue链接,所以当你添加一个IBAction ,你触发两次segue。

如果你去你的故事板,并点击赛格,你应该能够看到它的来源和目的地。 它的来源是整个视图控制器还是只是button? 如果原点是整个视图控制器,则只需手动执行。 你可以尝试评论你的[self performSegueWithIdentifier:@"toMoreDetail" sender:self]; 东西,看看是否会工作?

看起来如果你使用一个故事板并将你的segue从源码vc连接到目标vc,并使用didSelectRow调用segue,那么你不能为segueselect留下一个else语句:这个工作原理:

 if ((indexPath.row == 0 && indexPath.section == 0)) { [self performSegueWithIdentifier:@"simpleLines" sender:self]; } if ((indexPath.row == 0 && indexPath.section == 5)) { [self openAppStore]; } if (indexPath.section == 4) { [self performSegueWithIdentifier:@"pushSettingsVC" sender:self]; } 

这不起作用:

 if ((indexPath.row == 0 && indexPath.section == 0)) { [self performSegueWithIdentifier:@"simpleLines" sender:self]; } if ((indexPath.row == 0 && indexPath.section == 5)) { [self openAppStore]; } else { [self performSegueWithIdentifier:@"pushSettingsVC" sender:self]; } 

使用导航控制器时,您会发现奇怪的双击。 我每次开始一个项目都会这样做,总是忘记为什么会这样。 下次我