UINavigationController'损坏的导航栏'问题 [英] UINavigationController 'corrupted navigation bar' issue

查看:141
本文介绍了UINavigationController'损坏的导航栏'问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到严重的问题,让我的导航控制器工作,并尝试了几乎每一个相关的问题在这个网站。

I'm having serious problems getting my navigation controller to work and have tried pretty much every related question on this website.

我的问题是,当我执行以编程方式,在导航栏中似乎有一个过渡,但是视图不会改变。我看到以下错误:

My problem is that when I perform a segue programmatically, there appears to be a transition in the navigation bar, but the view doesn't change. I see the following errors instead:

2013-10-22 13:47:30.059 App[2236:a0b] nested push animation can result in corrupted navigation bar
2013-10-22 13:47:30.411 App[2236:a0b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-10-22 13:47:30.501 App[2236:a0b] Unbalanced calls to begin/end appearance transitions for 

$ b $的开始/结束外观转换的不平衡调用b

我的故事板看起来像这样:

My storyboard looks like this:

在LoginViewController中,我们根据一些条件执行segue:

In LoginViewController we perform a segue based on some condition:

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear];
    NSString* appState = [AppConfig getAppState];
    if ([appState isEqualToString:APP_STATE_WAITING]) {
        [self performSegueWithIdentifier:@"Load" sender:self];
    }
    else if ([appState isEqualToString:APP_STATE_REGISTRATION_AVAILABLE]) {
        [self performSegueWithIdentifier:@"SignUp" sender:self];
    }
}

在LoadingViewController中,我们等待来自Web服务的响应之前:

In LoadingViewController we wait for a response from a web service before doing:

- (void)segueToWaitingList:(NSUInteger)behind inFront:(NSUInteger)inFront
{
    [MosaycOptions setAppState:APP_STATE_WAITING];
    dispatch_async(dispatch_get_main_queue(), ^{
         [self performSegueWithIdentifier:@"Waiting" sender:self];
    });
}

这是segue,给我的问题。导航栏转换,但视图不会,我们看到以下错误打印出来:

And it is that segue that gives me the problem. The nav bar transitions but the view does not and we see the following errors printed out:

2013-10-22 13:47:30.059 App[2236:a0b] nested push animation can result in corrupted navigation bar
2013-10-22 13:47:30.411 App[2236:a0b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-10-22 13:47:30.501 App[2236:a0b] Unbalanced calls to begin/end appearance transitions for 

$ b $的开始/结束外观转换的不平衡调用b

应用程序不会崩溃,但没有发生segue,它不会转换到等待列表视图,而只是停留在加载并将错误输出到控制台。当我按回来而不是回到登录屏幕时,我得到以下空白屏幕:

The app doesn't crash, but no segue occurs, it doesn't transition to the waiting list view but simply stays on Loading and prints the error to console. When I press back rather than moving back to the login screen I get the following blank screen:

如果我再次按回来,会发生此错误: http://pastebin.com/7mCyeQv9

If I press back again it crashes with this error: http://pastebin.com/7mCyeQv9

很明显,导航堆栈,但是我已经使用调试器检查它,它看起来绝对精细,一切正常推送。我不能为我的生活计算出来。

Something is clearly getting messed up with the navigation stack, however i've inspected it using the debugger and it looks absolutely fine, everything gets pushed as normal. I can't for the life of me figure it out. This is just a standard navigation controller setup that i've used before.

任何想法?

推荐答案

我终于找出了问题。

performSegueWithIdentifier c $ c> viewDidAppear 在LoadingViewController上被调用。同步错误基本上。

performSegueWithIdentifier was being called before viewDidAppear was called on the LoadingViewController. A synchronisation error basically.

这篇关于UINavigationController'损坏的导航栏'问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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