Re: NSString of selected text in NSTextView
Re: NSString of selected text in NSTextView
- Subject: Re: NSString of selected text in NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Sat, 07 Nov 2009 19:20:29 -0800
NSTextView will usually take care of making sure that the selection is
a reasonable range. One complication is that in general NSTextView
supports multiple discontiguous selection ranges, and if such a
selection is in use, calling just -selectedRange will ignore it.
On Nov 7, 2009, at 6:06 PM, Kyle Sluder <email@hidden> wrote:
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
_______________________________________________
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