title: Presenting UIAlertController on subview causing window hierarchy warning in iOS 8
body: <p>This code has been working perfectly since iOS 4. I'm doing a preferences UITableViewController that's underneath the main view controller. When the prefs button is pressed, the main view slides to the left, showing the prefs table view. Very simple.</p>
  
  <p>One of the preferences items brought up a UIActionSheet. The problem is that in iOS 8, UIActionSheet is deprecated. Ok, so the easy thing to do would be to move to UIAlertController. Well, the problem is that when I click on the row that's supposed to bring up the UIAlertController, I get this:</p>
  
  <pre><code>Warning: Attempt to present &lt;UIAlertController: 0x7cab8bf0&gt; on &lt;PrefsTableController: 0x7be5c5b0&gt; whose view is not in the window hierarchy!
  </code></pre>
  
  <p>This does not happen in iOS 6 or iOS 7.</p>
  
  <p>The code to place the prefs vc is:</p>
  
  <pre><code>[self.window insertSubview:prefsTableController.view belowSubview:viewController.view];
  </code></pre>
  
  <p>Nothing to it, and it works great. The problem is that I don't understand why the view is now considered to be detached in iOS 8 when I clearly placed it in a view hierarchy.</p>
  
  <p>The code that presents the UIAlertContoller is:</p>
  
  <pre><code>[self presentViewController:view animated:YES completion:nil];
  </code></pre>
  
  <p>So, I'm at a total loss here. If I explicitly place view B under view A, why am I being told that view B is not in the view hierarchy?</p>
  
  <p>Thanks.</p>