0

In my application I want to push a different view from the ViewWillAppear of my current view. Application is running but I am getting a message in console is that

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

Can you help me.

TompaLompa
  • 949
  • 6
  • 17
kumar123
  • 791
  • 7
  • 21
  • 1
    could you add some code where the pushing occurs? – TompaLompa May 10 '12 at 07:45
  • http://stackoverflow.com/questions/5301014/ios-popviewcontroller-unexpected-behavior – Tom Meinlschmidt May 10 '12 at 07:54
  • - (void)viewWillAppear:(BOOL)animated { Aview* aObj = [[NRInstructionScreenVC alloc]initWithNibName: @"Aview" bundle:nil]; [self.navigationController pushViewController: aObj animated:YES]; [aObj release]; } – kumar123 May 10 '12 at 08:00

1 Answers1

1

In absence of some requested code I'll take a guess that you push your new viewController with the animated flag to YES. In that case set your previous ViewControllers transition to nonanimated. In other words(code):

[self.navigationController pushViewController:firstViewController animated:NO];

in its (firstViewController) ViewWillAppear:

[self.navigationController pushViewController:secandViewController animated:YES];
TompaLompa
  • 949
  • 6
  • 17
  • 1
    Thanks a Lot.It is working.But if you provide the reason then I am grateful to you. – kumar123 May 10 '12 at 08:10
  • in ViewWillAppear you push your nextViewController. So nextViewController gets added to the navigationstack before previousController hence the corruption – TompaLompa May 10 '12 at 08:28