• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextView read real text content (without 0xA added by wordwrap)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTextView read real text content (without 0xA added by wordwrap)
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: SecStaticCodeCheckValidity fails when app is lauched from Terminal
  • Next by Date: Re: Stupid objective-c question
  • Previous by thread: Re: Lifecycle for custom NSURLProtocol properties
  • Next by thread: Re: NSTextView read real text content (without 0xA added by wordwrap)
  • Index(es):
    • Date
    • Thread