What is the equivalent "sizeWithFont:" method for Mac?

I am familiar with sizeWithFont: for iPhone. Now I am trying to create a Mac application and need something similar, but I do not know how to do it: /

That's why I need it: I have a panel that displays some kind of text, and I want its size to just fit the content (a NSTextView ). How do you do this?

+7
nsstring size nstextview macos
source share
1 answer

Take a look at NSString sizeWithAttributes: You will need to create an attribute dictionary; see the Apple documentation for this.

+8
source share

All Articles