What to do about "Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted."
Asked Answered
W

4

6

I'm writing an iPhone app using Appcelerator Titanium Mobile. I am hiding and showing the tab group based on what window has focus.

dashWin.addEventListener("focus",function(e) {
    if (dashWin.tabGroupVisible == true) {
        dashWin.tabGroupVisible=false;
        tabGroup.animate({bottom:-50,duration:500});
    }
});

The code above hides the tab group when dashWin receives a focus event. However, I see this message in the Titanium console when the event fires while running in the iPhone simulator:

Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.

A Google search turns up one result: Another StackOverflow question that may have a hint as to what's going on.

Wagonlit answered 24/3, 2011 at 21:27 Comment(1)
Additional information: I only get the message when I use the Back button on a child window to return the tab to dashWin. If I use a tab to return to dashWin, I do not get the message.Wagonlit
S
2

Usually a tab group acts as the root of your app's navigation. When a user taps a tab, that tab's window is focused.

Next, when a user triggers an action that requires a new window appear, it usually appears either modally or on top (in the navigation stack sense) of the current window. In the latter case, tell the current tab to open the new window.

If you set the tabBarHidden property to false (when you create the new window), the tab bar will be hidden for you when the new window is opened by the current tab.

Will this more standard approach work for you?

Spiers answered 2/4, 2011 at 1:48 Comment(1)
I was unable to make the tab bar reappear on a child page in Titanium if I created it as hidden. At least that's my recollection. It was a week ago now and it seems like an eternity. But your answer implies, correctly, that I was creating a non-standard navigation experience for the user. I have since ditched that idea and am not using tabs at all. I looked at interfaces at pttrns.com for similar apps and realized the folly of my approach. Still, I'm curious exactly what the error message means, what one could do (if anything) about it, and why it seems to be very rare.Wagonlit
L
3

I got this error when I linked Action Segue or Selection Segue from one view to another view through storyboard and performed the same segue programmatically again, which makes the navigation controller perform the same segue twice.

2 solutions for this case:

  1. Removing the code that pushes the view. Just let storyboard perform the segue for you. This is good for most situations.
  2. Replacing Action Segue or Selection Segue with Manual Section and do - (void)performSegueWithIdentifier:(NSString *)identifier sender:(id)sender by yourself. You may find this solution useful when you want to customize the behavior of segue according to the sender.
Loris answered 27/1, 2014 at 9:5 Comment(0)
S
2

Usually a tab group acts as the root of your app's navigation. When a user taps a tab, that tab's window is focused.

Next, when a user triggers an action that requires a new window appear, it usually appears either modally or on top (in the navigation stack sense) of the current window. In the latter case, tell the current tab to open the new window.

If you set the tabBarHidden property to false (when you create the new window), the tab bar will be hidden for you when the new window is opened by the current tab.

Will this more standard approach work for you?

Spiers answered 2/4, 2011 at 1:48 Comment(1)
I was unable to make the tab bar reappear on a child page in Titanium if I created it as hidden. At least that's my recollection. It was a week ago now and it seems like an eternity. But your answer implies, correctly, that I was creating a non-standard navigation experience for the user. I have since ditched that idea and am not using tabs at all. I looked at interfaces at pttrns.com for similar apps and realized the folly of my approach. Still, I'm curious exactly what the error message means, what one could do (if anything) about it, and why it seems to be very rare.Wagonlit
B
0

I had segues that were leading back to my main navigation controller which was causing this. I fixed the problem by setting the main navigation controller back to the top of the stack. Here is the code:

- (void) viewDidAppear:(BOOL)animated
{
    [self.navigationController popToRootViewControllerAnimated:NO];
}
Brien answered 10/6, 2013 at 15:32 Comment(0)
D
0

Recently, I've faced the same problem. The reason was: -I was trying to pop view controller twice by mistake. you can check this crash by setting breakpoints on push and pop View controllers

Dira answered 31/7, 2014 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.