title: viewWillDisappear not called when calling popToRootViewControllerAnimated
body: <p>I work on a legacy application, and have found out, that my <code>view[Will/Did]Disappear</code> methods are not always fired properly.</p>
  
  <p>The case is, I have a (custom) <code>UIViewController</code> set as rootViewController in AppDelegate. This rootViewController has a <code>UINavigationController</code>, which has two view controllers pushed on it. When the user presses the home button, the user is logged out. When he later returns to the app, the application calls <code>[UINavigationController popToRootViewControllerAnimated:YES]</code> and then displays a modal <code>UIViewController</code> for logging in.</p>
  
  <p>The problem is: When I push/pop on the <code>UINavigationController</code> normally, my <code>viewWillDisappear</code> method is called properly. But when I use the <code>popToRootViewControllerAnimated:</code> method, <code>viewWillDisappear</code> is not called on any of the viewControllers that are popped off.</p>
  
  <p>Searching on the internet has only given two possible reasons:</p>
  
  <ul>
  <li><a href="http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/" rel="noreferrer">If using a UINavigationController as a subview, you must call <code>view[Will/Did]Disappear</code> yourself</a></li>
  <li><a href="https://stackoverflow.com/questions/7846932/poptoviewcontrolleranimated-does-not-animate-since-ios5">Not calling the proper super methods</a></li>
  </ul>
  
  <p>None of these suggestions are the case in my app. And I have no idea where to look. Anybody has a suggestion to what has been done wrong in the app?</p>