title: Attempt to present UIAlertController on UIViewController whose view is not in the window hierarchy
body: <p>I'm trying to check the UIAlertController in iOS 9 for my sample application and while run it then I had found warning in console. I'm using Xcode 7 and Objective C. </p>
  
  <p>Please find the below warning message in console.</p>
  
  <blockquote>
    <p>Warning: Attempt to present &lt; UIAlertController: 0x7fb1bb5be040 > on
    &lt; ViewController: 0x7fb1bb5aef30 > whose view is not in the window
    hierarchy!</p>
  </blockquote>
  
  <p>Please find the below code for more information.</p>
  
  <pre><code>UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert"
                                                                 message:@"This is an alert."
                                                          preferredStyle:UIAlertControllerStyleAlert];
  
  UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
                                                        handler:^(UIAlertAction * action) {}];
  
  [alert addAction:defaultAction];
  [self presentViewController:alert animated:YES completion:nil];
  </code></pre>