I'm struggling to find a good solution to this problem. In a view controller's -viewWillDisappear:
method, I need to find a way to determine whether it is because a view controller is being pushed onto the navigation controller's stack, or whether it is because the view controller is disappearing because it has been popped.
At the moment I'm setting flags such as isShowingChildViewController
but it's getting fairly complicated. The only way I think I can detect it is in the -dealloc
method.