NSTextView Retrieves Source

I want to find something that is equivalent to [fieldName stringValue] for NSTextField, but for NSTextView. I understand that the stringValue property does not exist for NSTextField because this field supports richer text.

Despite a lot, I cannot figure out how easy it is to get the original text content of an NSTextView. The only reason I use NSTextView and not NSTextField is that I have scrollbars ...

Definitely a new question!

Thanks in advance.

+3
source share
1 answer

NSTextField is a subclass of NSText that has a "string" method. Try the following:

[myTextField string];

It should work as needed.

+9
source

Source: https://habr.com/ru/post/1792698/


All Articles