3
votes

I want to find something that is the equivalent of [fieldName stringValue] for NSTextField, but for NSTextView. My understanding is that the stringValue property doesn't exist for the NSTextField because this field supports richer text.

Despite much googling I can't figure out how to just get the raw text content of the NSTextView. The only reason I'm using the NSTextView and not NSTextField is so I can have scroll bars...

Definitely a newb question!

Thanks in advance.

1
When you say raw text content, do you mean a rich text string or a plain text string?user557219
I mean plaintext string, thanks, that is an important clarification!ComputationalSocialScience

1 Answers

9
votes

NSTextField is a subclass of NSText, which has a "string" method. Try this:

[myTextField string];

It should work as needed.