title: iOS5: Exception on UIWebView in modal UIViewController playing Youtube video
body: <p><strong>UPDATE:</strong> No longer occurs on iOS 6 beta 1</p>
  
  <p>I am currently working on adapting an existing iOS 4 application with the new iOS 5 SDK.
  I found a new crash when presenting a UIWebView in a modal view controller that reads a Youtube video.</p>
  
  <p>Starting to read the video is fine, but when I try to set it in full screen, I get the following exception :</p>
  
  <pre><code>Exception: UIViewControllerHierarchyInconsistency,
  child view controller:&lt;UIViewController: 0x6aef180&gt; 
  should have parent view controller:&lt;WebViewController: 0x6a706c0&gt; 
  but requested parent is:&lt;MPInlineVideoViewController: 0x6ae5d40&gt;
  </code></pre>
  
  <p>Here is how I instanciate and present my modal view controller in my main view controller :</p>
  
  <pre><code>- (IBAction)buttonReleased:(id)sender
  {
      WebViewController *webVC = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]];
      webVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
      webVC.modalPresentationStyle = UIModalPresentationPageSheet;
      [self presentModalViewController:webVC animated:YES];
  }
  </code></pre>
  
  <p>I use the UIModalPresentationPageSheet as modalPresentationStyle, when I set this value to UIModalPresentationFullScreen, the error no longer occurs.</p>
  
  <p>In my modal WebViewController, here is how I load my Youtube video :</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=bDlm3eLRut0"]]];
  }
  </code></pre>
  
  <p>Any ideas on this problem ?
  I can provide a full sample code that isolates this crash if needed.</p>
  
  <p>Thanks !</p>