Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the text of a NSTextView programmatically

I can't find any parameter that seems to be related with the text value showed in a NSTextView. I understood that a NSTextView uses a complex structure (with NSLayoutManager etc...), but I can't find a valid way to modify the current text value.

like image 760
MatterGoal Avatar asked Feb 01 '13 12:02

MatterGoal


2 Answers

The right method is "setString" [textView setString:@"the string"];

like image 104
MatterGoal Avatar answered Nov 09 '22 00:11

MatterGoal


Setting text on outlet textView Swift Xcode 8.0

textView.string = newString
like image 45
Peter Ahlberg Avatar answered Nov 09 '22 01:11

Peter Ahlberg