- In IB (Interface Builder) add an NSImageView to the window.
- Select the NSImageView.
- From the menu select Select Layout ~~> Embed Objects In~~> Scroll View.
- Select the NSScrollView press Cmd+3 and configure the NSScrollView to expand and fill all available space.
- Remove the NSImageView's border
- Use this code to resize the NSImageView's frame to match the size of the NSImage
NSImageView *imageView = ...;
[imageView setFrameSize:viewSize];
NSLog(@"imageView's frame after resizing: %@", NSStringFromRect([imageView frame]));