0

I tap a tab bar item, which triggers poptoRootViewControllerAnimated. Most of the time it works as expected, but in some cases it pops to the correct view, but the navigation item is out of sync, "stuck" from the view i previously was at.

I've read about people having this problem with iPad's, when in landscape mode, but the solutions I've found don't work in this case. This is an iPhone app in portrait mode.

Happens with the simulator as well as on an actual iPhone. If someone has a suggestion or solution i'll be a very happy man!

trydis
  • 3,772
  • 1
  • 24
  • 31
  • did you add a UITabBarController to the navigation controller? – Swapnil Luktuke May 05 '11 at 19:04
  • There's a UITabBarController at the root of the hierarchy, with a UINavigationController for each item in the toolbar. The problem only occurs with one of them. – trydis May 05 '11 at 19:23

2 Answers2

1

Turns out that the different iOS versions handle this differently. This only occured on the older versions, so we had to rebuild the stack manually there.

trydis
  • 3,772
  • 1
  • 24
  • 31
0

do you get any message in the console like

nested push animation can result in corrupted navigation bar

and

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

if yes take a look at these few answers... but what they all basically mean is you are trying to pop from the navigation controller too early, probably before it is properly loaded...

Community
  • 1
  • 1
Swapnil Luktuke
  • 10,034
  • 2
  • 34
  • 55
  • No, it happens when i tap the tab bar item, which calls popToRootViewControllerAnimated. Though only when doing a certain combination of actions in the previous view, before popping to the root. I've got a UINavigationController subclass, which overrides popToRootViewController and has a fake view controller at index 0. I can then pop to the view controller at index 1 which will be the logged out / logged in view controller depending on the actions of the user. It seems that i will have to take a different approach, instead of inserting a fake vc at index 0, which should be doable. – trydis May 06 '11 at 21:17