• 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
Re: NSString of selected text in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString of selected text in NSTextView


  • Subject: Re: NSString of selected text in NSTextView
  • From: Kyle Sluder <email@hidden>
  • Date: Sat, 7 Nov 2009 18:06:41 -0800

On Sat, Nov 7, 2009 at 5:57 PM, Todd Heberlein <email@hidden> wrote:
> This seems like a simple task, but it has become a series of steps. Am I
> missing a simple method that will do this?

[[myTextView string] substringWithRange:[myTextView selectedRange];

(Warning, composed in Mail.  Potential thorny issues with text
attachment characters, surrogate pairs, composed characters, marked
text… "the selected text" isn't as simple of a concept as it may
seem.)

--Kyle Sluder
_______________________________________________

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: NSString of selected text in NSTextView
      • From: Todd Heberlein <email@hidden>
    • Re: NSString of selected text in NSTextView
      • From: Douglas Davidson <email@hidden>
    • Re: NSString of selected text in NSTextView
      • From: Douglas Davidson <email@hidden>
References: 
 >NSString of selected text in NSTextView (From: Todd Heberlein <email@hidden>)

  • Prev by Date: NSString of selected text in NSTextView
  • Next by Date: Re: NSString of selected text in NSTextView
  • Previous by thread: NSString of selected text in NSTextView
  • Next by thread: Re: NSString of selected text in NSTextView
  • Index(es):
    • Date
    • Thread