Calling popViewControllerAnimated twice

前端 未结 4 1374
臣服心动
臣服心动 2021-01-30 11:26

I\'ve got a UINavigationController with a series of UIViewControllers on it. Under some circumstances, I want to pop back exactly two levels. I thoug

4条回答
  •  孤城傲影
    2021-01-30 11:52

    In this case you would need to pop back to a specific viewcontroller in the navigationController like so:

    [self.navigationController popToViewController:[[self.navigationController viewControllers] objectAtIndex:2] animated:YES];
    

    That code would pop to the third viewcontroller on the navigationController's stack.

提交回复
热议问题