title: Application tried to present modally an active controller : UIImagePickerController
body: <p>I'm struggle at this for 2 days and believe that this is the moment I should call for help. After I search SOF for a while, none of any answer could solve my problem. Here are my application ...</p>
  
  <p>In the application, </p>
  
  <ul>
  <li>Device is iPad, iOS 6</li>
  <li>RootViewController is NavigationController</li>
  <li>TopViewController is TabBarController</li>
  <li>In this TabBarController, I present a popoverController from right bar button of navigation bar</li>
  <li>In presenting popover there is a button to allow user to pick image from by taking new one or pick from existing.</li>
  <li>To pick new one, I presentViewController UIImagePickerController to allow user to take photo with divice camera. <strong>presentModalViewController:animated:</strong> if iOS &lt; 6, and <strong>presentViewController:animated:completion:</strong> for iOS > 6</li>
  <li>I also hide Status Bar before presentation</li>
  <li>To select from existing photo, I do <strong>presentPopoverFromBarButtonItem:permitArrowDirections:animated:</strong></li>
  <li>PopoverViewController also referencing by A TabBarController</li>
  </ul>
  
  <p>Here is the issue</p>
  
  <ul>
  <li>Present UIImagePickerController will always failed if user try to pick new one first with exception <strong>"Application tried to present modally an active controller &lt;[name of view controller that try to present]>"</strong></li>
  <li><strong>BUT</strong>, if user try to pick image from camera roll for once and then try to take new one again, it won't fail.</li>
  </ul>
  
  <p>Here are what I tried</p>
  
  <ul>
  <li>present from RootViewController</li>
  <li>present from TopViewController (TabBarController)</li>
  <li>present from popoverViewController itself</li>
  <li>present from a tab of TabBarController</li>
  <li>hide popoverViewController before presentation</li>
  <li>resignFirstResponder from a textField in popoverViewController</li>
  </ul>
  
  <p>Here is the current code I'm using</p>
  
  <pre><code>// PopoverViewController, presented by a tab in TabBarController
  - (IBAction)takePhoto:(id)sender {
      [self.delegate takePhotoWithDeviceCamera];
  }
  
  // A Tab in TabBarController, delegate of popoverViewController
  - (void)takePhotoWithCamera {
      [[UIApplication sharedApplication] setStatusBarHidden:YES];
      if ([UIDevice OSVersion] &lt; 6.0) {
          [self presentModalViewController:cameraPicker animated:YES];
      } else {
          [self presentViewController:cameraPicker animated:YES completion:nil];
      }
  }
  </code></pre>
  
  <p>Any idea what would cause this error? Any suggestion are welcome. Thank you.</p>