0
votes

I have 3 view controllers, in which i have to segue from first to third via the second controller, without the second controller being viewed. The second controller has a button which does the segue controller 2--> controller 3.

i have tried

[self performSegueWithIdentifier:@"addItem" sender:self ];

in second controller's viewDidLoad. But, instead of segueing to the 3rd controller it is going to an unknown controller . with a message in terminal saying . 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. when i press back button on that unknown controller, it is coming back to my intended destination(3rd controller) and it is working well from there .

1
Why don't you directly goto controller 1--> controller 3?Neo
i need to go through 2nd controller cuz when i call the back button it should go to 2nd one . and the second has a button which segues to 3rd . so if i push the 3rd to second instead of popping it creates an infinite loop of stacking objects .shashank
As you mentioned "i need to go through 2nd controller cuz when i call the back button it should go to 2nd one", ok lets say your code worked fine but when u click back button, the viewWillAppear will be called again it your 2nd controller which will again perform segue to 3rd controllerNeo
how are u performing seguing in the 3rd controller?Neo
after putting it in view did load , iam getting the following warning in the terminal. 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. (iam not segueing anywhere in third controller . its the final controller in my navigation tree)shashank

1 Answers

0
votes

Got the Answer. For this we need to set one animation to 'No' in

pushViewController: animated:NO .
This prevents nested push animation