1
votes

I have 3 view controller in Navigation stack and I work with them all. After removing some VCs and finally presenting third iOS removes second VC from Navigation stack. I need it. How can I save VC in Navigation stack and stop it removal?

I tried to ave it in app delegate property and then pop to it but have this error: * Assertion failure in -[MenuNavigationController popToViewController:transition:], /SourceCache/UIKit_Sim/UIKit-2935.137/UINavigationController.m:4912

        FeedViewController *vc = (FeedViewController *)[self appDelegate].feedViewController;
        [self.navigationController popToViewController:vc animated:YES];
1

1 Answers

0
votes

the navigation stack should have the vc you want to pop to in its hierarchy. Also, i m not very sure i got your question, could you re-phrase it?

what i understood from your question is that you have 3 controllers in hierarchy - FirstVC, SecondVc andThirdVC in which FirstVC was the first view presented and thirdVC was the last to appear after pushing views in succession and somehow, you navigate to a fourthVC and then when you come back to your ThirdVc, the secondVC automatically vanishes from the hierarchy. Is my understanding correct?