iPhone - dismiss multiple ViewControllers

后端 未结 22 3036
粉色の甜心
粉色の甜心 2020-11-28 04:46

I have a long View Controllers hierarchy;

in the first View Controller I use this code:

SecondViewController *svc = [[SecondViewController alloc] i         


        
22条回答
  •  失恋的感觉
    2020-11-28 05:41

    First of all Oscar Peli thanks for your code.

    To start your navigationController at the beginning, you could make it a little more dynamic this way. (in case you don't know the number of ViewControllers in stack)

    NSArray *viewControllers = self.navigationController.viewControllers;
    [self.navigationController popToViewController: [viewControllers objectAtIndex:0] animated: YES];
    

提交回复
热议问题