For a MacOS app, I have a Window, containing an `NSView`; into that view, I want to add a subview with a constant size and height.

When loading the subview programmatically by `[myView addSubview:mySubview]`, I want the `NSView *myView` that is hosting the subview to change in size so it accomodates the subview, and the window to change in size accordingly; so that the edges of the NSView inside that Window keep the same distance to their surroundings in the Window as before. How do I achieve that most efficiently and which properties do I have to specify in IB to make that work? Do I have to adjust the size of `myView` and of the Window programmatically by hand or can I achieve this in a more beautiful way?