NSTextView read real text content (without 0xA added by wordwrap)
NSTextView read real text content (without 0xA added by wordwrap)
- Subject: NSTextView read real text content (without 0xA added by wordwrap)
- From: Felipe Monteiro de Carvalho <email@hidden>
- Date: Tue, 27 Sep 2016 09:31:36 +0200
Hello,
I have a normal NSTextView and I would like to programatically read
the text inside it.
This is trivial, just call txt.string or txt.textContainer.string
But the resulting string contains line endings which are added in the
places where the word-wrap takes places, and I need the raw text,
without such added line endings.
Note that I don't want to disable word-wrap!
I assume that Cocoa must know the original text, because otherwise it
would not be able to change the wraping when the control is resized.
Any ideas how to obtain the original text? I tried google to no luck
:( Seams like noone had this problem before.
And no, manually removing all line endings is not what I want, because
some line endings are part of the real text, not added by word-wrap.
thanks in advance,
--
Felipe Monteiro de Carvalho
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden