title: Dismiss one modal view controller after showing another
body: <p>I've done a bit of research and read other answers I found here but haven't found anything that actually works. I have an app that when something is posted I want to go to the post and if the back button is pressed when viewing the post it should go back two views basically skip over the compose view.</p>
  
  <p>Below is what I've tried but it gives </p>
  
  <p>Warning: Attempt to present on whose view is not in the window hierarchy!</p>
  
  <pre><code>-(IBAction)post{
      [[self presentingViewController] dismissModalViewControllerAnimated:NO];
  }
  
  -(void)viewDidDisappear:(BOOL)animated{
      [super viewDidDisappear:animated];
      ViewPostViewController *dvController = [[ViewPostViewController alloc] initWithNibName:@"ViewPostViewController" bundle:[NSBundle mainBundle]];
      UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:dvController];
      nc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
      [self presentModalViewController:nc animated:NO];
      [nc release];
  }
  </code></pre>