title: Setting up auto layout constraints for programmatic view hierarchy?
body: <p>I'm creating my view hierarchy programmatically like this:</p>
  
  <pre><code>UIWindow* window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  
  UIViewController1* viewController1 = [[UIViewController1 alloc] init];
  UIViewController2* viewController2 = [[UIViewController2 alloc] init];
  
  UINavigationController* navigationController = [[UINavigationController alloc] init];
  [navigationController setViewControllers:@[viewController1, viewController2] animated:NO];
  
  [window setRootViewController:navigationController];
  [window makeKeyAndVisible];
  </code></pre>
  
  <p>The two VC are loaded from XIB's that in both cases use autolayout. Everything looks good but when I actually do a <code>po [[UIWindow keyWindow] _autolayoutTrace]</code> I get some worrying <code>AMBIGUOUS LAYOUT</code> warnings in the console:</p>
  
  <pre><code>*&lt;UIWindow:0xc63bec0&gt;
  |   *&lt;UILayoutContainerView:0xd3d79b0&gt; - AMBIGUOUS LAYOUT
  |   |   *&lt;UINavigationTransitionView:0xd3d8b60&gt; - AMBIGUOUS LAYOUT
  |   |   |   *&lt;UIViewControllerWrapperView:0xd566c00&gt; - AMBIGUOUS LAYOUT
  |   |   |   |   *&lt;UIView:0xc66b290&gt; - AMBIGUOUS LAYOUT
  |   |   |   |   |   *&lt;UIView:0xc66b0e0&gt; - AMBIGUOUS LAYOUT
  |   |   |   |   |   |   *&lt;MKMapView:0xd504800&gt; - AMBIGUOUS LAYOUT
  </code></pre>
  
  <p>So my question is, how do I get rid of them? 
  Or more generally formulated, how do you go about setting up your window and view hierarchy programmatically using auto layout?</p>
  
  <p>I find the documentation very vague on the matter of setting up the window programmatically. And even though I watched all of the three WWDC videos on the matter I could not get a grip on how to do this.</p>
  
  <p>EDIT: It appears as the issues I'm having only relate to the new iOS 7. Since it's under NDA I will move this discussion to the designated Apple Developer Forums. </p>