嵌套推送动画可能导致导航栏损坏多次警告

2023-06-12移动开发问题
13

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

问题描述

我是 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?

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

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?
How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)...
2024-08-12 移动开发问题
13