NSTableView height

I have (what I thought was) a very simple mac OS project view consisting of a window, a tabbed view with 2 tabs and in one of these tabs a tableview.

When I run it it works as expected; however sometimes the datasource contains more rows than will display; in this case the vertical scroll works fine. I can drag the window frame to "resize" the window but the tableview height does not change.

To fix this problem I added 2 constraints to the border scroll view of the table - for top space and bottom space - both set relative to its superview. The top space is set to a fixed value and the bottom space is set to "default".

When I do this there are no layout constraint errors but when I run it, the table doesn't appear at all. Any thoughts or suggestions?

Replies

You need also to set a constraint for the view (the superview) relative to bottom of its superview.
In fact, you should set constraints in all 4 directions.

thanks for the response! I did get it to work after adding a few more constraints - the main one being a trailing constraint on the bordered scroll view (containing the table view).
That's logical.

As you had defined some constraints (top and bottom, may be leading as well ?), you need to define constraints for all directions, as I told in previous post.