Change the text of a NSTextView programmatically
The right method is “setString” [textView setString:@”the string”];
The right method is “setString” [textView setString:@”the string”];
Could someone explain to me what are the main differences between NSTextField and NSTextView? I know that NSTextView has more features and is usually used for longer texts, and NSTextField is usually used for one-line plain text fields, but if I understand correctly, NSTextField can be also used with attributed strings and with multiple lines… … Read more
-[NSAttributedString boundingRectWithSize:options:] You can specify NSStringDrawingUsesDeviceMetrics to get union of all glyph bounds. Unlike -[NSAttributedString size], the returned NSRect represents the dimensions of the area that would change if the string is drawn. As @Bryan comments, boundingRectWithSize:options: is deprecated (not recommended) in OS X 10.11 and later. This is because string styling is now dynamic … Read more