title: Shift to Parent View Controller from child view controller - iOS
body: <p>I have a main Actions View Controller, and on that there is button "Review". Review Button's functionality is :</p>
  
  <pre><code> - (IBAction)btnReview:(id)sender
  {
      ReviewViewController *vc = [[ReviewViewController alloc]initWithNibName:@"ReviewViewController" bundle:nil];
      [self addChildViewController:vc];
      [vc didMoveToParentViewController:self];
      [self.view addSubview:vc.view];
  }
  </code></pre>
  
  <p>Now on Review Page, I have a button. And on that button's action, I want to switch back to Parent View Controller. Its view should be displayed. I have tried following code, it either pauses or crashes application.</p>
  
  <pre><code>[self didMoveToParentViewController:nil];
  [self.view removeFromSuperview];
  [self removeFromParentViewController];
  </code></pre>
  
  <p>I even tried:</p>
  
  <pre><code>[self dismissModalViewControllerAnimated:YES]
  </code></pre>
  
  <p>I have read other posts related to this question as well but could not find a satisfactory answer. Please Help!</p>