There are a couple methods in NSStringDrawing.h in the AppKit
for getting the size for an NS[Attributed]String, but these don't
deal with text that needs to be wrapped based on a max width.
Are you sure using an NSTextView (as opposed to an NSTextField) and calling sizeToFit doesn't work? You should be able to use NSHeight([textView frame]) after that call... but maybe there is a problem with it.
Otherwise... ick. You'll probably have to get down and dirty with NSTextStorage, NSLayoutManager, and NSTextContainer. I think you have
to create those three objects and point them all to each other, set the text container's size to what you want (i.e. fixed width and big big height), set the text into the text storage (may have to bracket with beginEditing ... endEditing), call a method on NSLayoutManager to force the layout (glyphRangeForTextContainer or textContainerForGlyphAtIndex:effectiveRange: maybe?) then call usedRectForTextContainer to get the rect you want.
Looks like there is a private _sizeWithSize:attributes: method on NSString that probably does exactly what you want (_sizeWithSize: on NSAttributedString), but darn it it's private. That would be a rather useful one to make public... or at least a sizeWithMaxWidth or something.