title: NSImageView size does not follow its window's
body: <p>I'm just playing around with OSX app dev. I'm totally noob. I thought it is straight forward like iOS app dev. But after a few days of going at this, it seems it is not that easy.</p>
  
  <p>Here's what I'm trying to do. I have a NSWindow. In it in which I put an Image Well (wth with the naming? lol) Well "Image Well", it is an NSImageView (no pun intended).</p>
  
  <p>So I just want the NSImageView's frame to resize following the NSWindow's size. It's that simple.</p>
  
  <p>Here's what I did that is NOT working:</p>
  
  <p>NSImageView as imageView.</p>
  
  <p>write the delegate method NSWindowDelegate method of NSWindow windowDidResize and windowDidResize: and just resize the framesize of imageView frame of the image view in it. Code: (The NSImageView is in a property called imageView.)</p>
  
  <pre><code>- (void)windowDidResize:(NSNotification *)notification {
  
     // NSLog(@"resized");
  
      NSRect zWindowRect = [[self window]frame];
      NSRect zContentRect = [[self window]contentRectForFrameRect:zWindowRect];
  
      [self.imageView setFrameSize:NSMakeSize(zContentRect.size.width,
                                              zContentRect.size.height)];
  
      [self.imageView setNeedsDisplay:YES];
  
  
  }
  </code></pre>
  
  <p>This method is called (tested that with <code>NSLog()</code>), however the <code>NSImageView</code> just stays there with the original size.  I checked that the <code>IBOutlet</code> connection is OK. </p>
  
  <p>What gives? Why won't the <code>NSImageView</code> resize?</p>