Popping multiple levels in UITableViewController

后端 未结 2 2047
别跟我提以往
别跟我提以往 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.

    0 讨论(0)
  • 2021-01-22 19:58

    What you want is to send popToViewController: animated: to the navigation controller. You can use the navigation controller's viewControllers property to figure out which view controller it is that you want to pop to.

    0 讨论(0)
提交回复
热议问题