Popping multiple levels in UITableViewController

后端 未结 2 2048
别跟我提以往
别跟我提以往 2021-01-22 19:40

I would like to be able to pop multiple views from a UITableViewController stack. For example in the Apple DrillDownSave example, when viewing Level 3 to go back to Level 1 or

2条回答
  •  孤街浪徒
    2021-01-22 19:52

    Thank you Giao that did it. I changed my code to:

    NSArray *allViewControllers = self.navigationController.viewControllers;
    NSInteger n = [allViewControllers count];
    [self.navigationController popToViewController: [allViewControllers objectAtIndex: (n-3)] animated: YES];
    

    and it works perfectly.

提交回复
热议问题