title: Adding subviews in NSWindow while resizing the windows, the UI gets jumbled
body: <p>I have a window and a subview is added, this subview is the container of another view(accessed and added using <code>NSViewController</code>).
  I have disabled autolayout and doing resizing from springs. The subviews gets resize correctly on window resize. </p>
  
  <p>If I add / remove subviews keeping the window size same it works fine. But if I add subview and maximize it and then remove and then add, it gets jumbled. </p>
  
  <p>Some time it happens straight forward as :</p>
  
  <p>Open the main window (it opens in small size). Maximize it, then add the subview, the subview is added to its original size as drawn in xib. Expected behavior is the subview should get expand and cover the main window.</p>
  
  <p>I am not able to find the solution. Please help me to fix this. The sample code and <a href="http://www.keepandshare.com/doc/7349581/windowrestore-zip-40k?da=y" rel="nofollow">sample project</a> is attached here.</p>
  
  <pre><code>//In AppDelegate
  
  - (IBAction)buttonClicked:(id)sender {
      if (!self.myVC) {
          self.myVC = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
      }
      [self.containerView addSubview:self.myVC.view];
  }
  
  - (IBAction)clearClicked:(id)sender {
  
      for (NSView *view in self.containerView.subviews) {
          [view removeFromSuperview];
      }
  
  }
  </code></pre>