I'm building a chat application with the chat pane as an NSTableView and each message held within a custom cell in a row in that table. I need to make the table row height relative to the message size. After many frustrations with trying to calculate the size of the wrapping text within an NSTextField (holding the message), and then finding out that NSTextField is notoriously bad for this (see here, which is corroborated by my findings. Furthermore, NSTextField resizes completely randomly on occasion (a single message with "?" will resize to be about 5 lines high...) which I'm hoping NSTextView will avoid), I've decided to use an NSTextView instead.
But I can't add an NSTextView to my application within it being embedded in an NSScrollView. I certainly do not want my message boxes to scroll -- I want them to grow depending on the size of their contents. But I can't drag the TextView out of the ScrollView. I tried adding a custom view and setting it to be a TextView, but although I hooked it up to my ViewController in precisely the way I had done my TextField, it didn't display anything.