Calling popViewControllerAnimated twice

前端 未结 4 1402
臣服心动
臣服心动 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:41

    Also, as to what you were doing wrong, I believe the reason why [self.navigationController popViewControllerAnimated:YES] isn't working the second time is because you are probably making this second call on the screen that is being popped on the first call. After the first call, the current view is removed from the navigation controller, so by the time you make the second call, self.navigationController will return nil because it no longer has a navigation controller.

提交回复
热议问题