title: UINavigationController presentModalViewController in rootviewcontroller didn't present with animations
body: <p>I have a situation that need to judge  a invalid session and present the loing view controller.Now, after I get the message from server. I judge the statuscode . If it is a session error, I post a notification. The rootviewcontroller will handle the notification. Here is my Code in rootviewcontroller:</p>
  
  <pre><code>- (void)handleInvalidSessionNotification:(NSNotification *)notification{
  UINavigationController * tmpController = self.navigationController;
  [tmpController popToRootViewControllerAnimated:NO];
  LoginViewController * loginViewController = [[LoginViewController alloc] init];
  UINavigationController * naviController = [[UINavigationController alloc] initWithRootViewController:loginViewController];
  naviController.navigationBarHidden = YES;
  [self.navigationController presentModalViewController:naviController animated:YES];
  </code></pre>
  
  <p>}</p>
  
  <p>Initially it did not work. I found this link <a href="https://stackoverflow.com/questions/954982/uinavigationcontroller-poptorootviewcontroller-and-then-immediately-push-a-new">UINavigationController popToRootViewController, and then immediately push a new view</a> , and change the Code:</p>
  
  <pre><code> UINavigationController * tmpController = self.navigationController;
  [tmpController popToRootViewControllerAnimated:NO];
  </code></pre>
  
  <p>It works, but no animations, do someone have a solution or suggestion....  Thanks for your help</p>