View disappears when I set `translatesAutoresizingMaskIntoConstraints` to `NO` <p>I don't know if this is a bug or I'm doing something wrong:</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIWindow *window = [self window]; UIViewController *main = [[UIViewController alloc] init]; UIViewController *vc1 = [[UIViewController alloc] init]; UIViewController *vc2 = [[UIViewController alloc] init]; [main addChildViewController:vc1]; [main addChildViewController:vc2]; UIView *mainView = [main view]; UIView *v1 = [vc1 view]; UIView *v2 = [vc2 view]; [v1 setBackgroundColor:[UIColor redColor]]; [v2 setBackgroundColor:[UIColor blueColor]]; [v1 setTranslatesAutoresizingMaskIntoConstraints:NO]; [v2 setTranslatesAutoresizingMaskIntoConstraints:NO]; [v1 setClipsToBounds:YES]; [v2 setClipsToBounds:YES]; [mainView setBackgroundColor:[UIColor yellowColor]]; [mainView addSubview:v1]; [mainView addSubview:v2]; NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:v1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:mainView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.0]; [mainView addConstraint:constraint]; constraint = [NSLayoutConstraint constraintWithItem:v1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:240.0]; [mainView addConstraint:constraint]; constraint = [NSLayoutConstraint constraintWithItem:v2 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:v1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0]; [mainView addConstraint:constraint]; [window setRootViewController:main]; [window setBackgroundColor:[UIColor greenColor]]; [window makeKeyAndVisible]; [main release]; [vc1 release]; [vc2 release]; return YES; } </code></pre> <p><code>v1</code> and <code>v2</code> appears nowhere when I launch the app.</p> <p>If I comment out:</p> <pre><code>[v1 setTranslatesAutoresizingMaskIntoConstraints:NO]; [v2 setTranslatesAutoresizingMaskIntoConstraints:NO]; </code></pre> <p>Cocoa wouldn't be able to satisfy my constraints because of the autoresizing mask that was translated into constraints.</p>