I'm creating my view hierarchy programmatically like this:
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];
The two VC are loaded from XIB's that in both cases use autolayout. Everything looks good but when I actually do a po [[UIWindow keyWindow] _autolayoutTrace]
I get some worrying AMBIGUOUS LAYOUT
warnings in the console:
*<UIWindow:0xc63bec0>
| *<UILayoutContainerView:0xd3d79b0> - AMBIGUOUS LAYOUT
| | *<UINavigationTransitionView:0xd3d8b60> - AMBIGUOUS LAYOUT
| | | *<UIViewControllerWrapperView:0xd566c00> - AMBIGUOUS LAYOUT
| | | | *<UIView:0xc66b290> - AMBIGUOUS LAYOUT
| | | | | *<UIView:0xc66b0e0> - AMBIGUOUS LAYOUT
| | | | | | *<MKMapView:0xd504800> - AMBIGUOUS LAYOUT
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?
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.
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.