title: cannot close RootViewController
body: <p>In Xcode 4 I've created a SplitView project, so I have a DetailViewController and a RootViewController.</p>
  
  <p>In RootViewController's viewDidLoad(), I have added a cancel button on the left side like this</p>
  
  <pre><code>// add a cancel button on the left side
  cancelButton = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCancel 
                                                               target:self action:@selector(cancelAction:)] autorelease];
  self.navigationItem.leftBarButtonItem = cancelButton;
  </code></pre>
  
  <p>When the RootViewController is displayed and I click on the cancel button, I want to close the RootViewController. In my cancelButton handler I've tried calling</p>
  
  <pre><code>#if 0
      [self dismissModalViewControllerAnimated:YES];
  #else   
      [self.navigationController popViewControllerAnimated:YES];
  #endif
  </code></pre>
  
  <p>but neither one of them work for me. I've tried googling for hours but have still not found a solution.</p>
  
  <p>Can someone please tell me how to close the RootViewController?</p>
  
  <p>thanks for your help</p>