0
votes

in one of my viewcontroller, lets say A, I have the following:

 OnbViewController *on = [[OnbViewController alloc] initWithNibName:nibName bundle:nil];
        onboardingTutorial.delegate_ = self;
self.test = on
 UINavigationController *nController = [[UINavigationController alloc] initWithRootViewController:self.test]
[self presentModalViewController:nController]
[nController release];

then inside OnbViewController I have pushed to the navigationController:

[self.navigationController pushViewController:someViewController];

then in didSelectRowForIndexPath: I called a delegate, which is A, inside the delegate function I called I tried to push again by doing:

[self.test pushViewController:someOtherViewController];

and then this gives me that error:

nested push animation can result in corrupted navigation bar
Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
   Unbalanced calls to begin/end appearance transitions for <someOtherViewController: 0x6f942e0>.

any idea?

2

2 Answers

2
votes

Rather convoluted calling sequence, but the first issue I see is that it looks like you're calling pushViewController on an OnbViewController, not on its navigationController. Maybe changing to [self.test.navigationController pushViewController:someOtherViewController]; will suffice?

Edit: in looking further at this, I note the "animation" in "nested push animation". Is onbViewController pushing to someViewController during its viewWillAppear or somewhere early like that? Maybe skipping the second animation will work?

0
votes

It's a real tangle of pointers getting created there. self.test is the root vc of a navigation controller (nController). You present the nController modally, and then push other view controllers onto it's vc stack.

Then, while that stack is still there, you push onto self.test, which is like pushing onto the root again.

Let the VC that's getting the didSelectRow message do the push. You can still tell the delegate that it happened.