title: MacOSX swift NSLayoutContraint Resizes Wrong Object
body: <p>I programmatically add a button to an NSWindow's content view and when I add a constraint to center it, the button is not moved and instead the window is made smaller:</p>
  
  <p><a href="http://i.stack.imgur.com/GybsX.png" rel="nofollow">Here is a picture of it</a></p>
  
  <pre><code>    windowN=NSWindow(contentRect: NSMakeRect((NSScreen.mainScreen()!.visibleFrame.width/2)-100, (NSScreen.mainScreen()!.visibleFrame.height/2)-100, 200, 200), styleMask: NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask, backing: NSBackingStoreType.Buffered, `defer`: false, screen: NSScreen.mainScreen())
  
      windowN.releasedWhenClosed=false
      windowN.makeKeyAndOrderFront(self)
      windowN.title="Title"
      windowN.minSize=NSSize(width: 100, height: 100)
  
      let s=NSStoryboard(name: "Storyboard", bundle: NSBundle.mainBundle())
      windowN.contentView?=(s.instantiateControllerWithIdentifier("Me") as! NSViewController).view
      var view=windowN.contentView!
      button=NSButton(frame: NSMakeRect(0,0,100,30))
      button.setButtonType(NSButtonType.MomentaryPushInButton)
      button.bezelStyle=NSBezelStyle.RoundedBezelStyle
  
  
      button.title="Hello"
  
      view.addSubview(button)
      view.addConstraint(NSLayoutConstraint(item: view, attribute: NSLayoutAttribute.CenterX, relatedBy: NSLayoutRelation.Equal, toItem: button, attribute: NSLayoutAttribute.CenterX, multiplier: 1, constant: 0))
      windowN.delegate=self
  </code></pre>
  
  <p>No errors are thrown.</p>
  
  <p>Thanks,</p>