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: Mon, 9 Nov 2009 09:28:25 -0800
On Nov 9, 2009, at 9:02 AM, Jens Alfke wrote:
On Nov 7, 2009, at 7:49 PM, Todd Heberlein wrote:
Yeah, one of the concerns I had was whether the selected NSRange is
preserved when -string is called.
I've always assumed it is. That is, all character indexes that
appear in the NSText[View] API correspond to character positions in
the textStorage's string. It seems that this has to be true, because
there's no other meaningful way to define the character indexes.
Yes, that's correct. Within a given text view, the character indexes
are the same between the text storage and its underlying string, and
these are the character indexes used by the layout manager and the
text view. Processes such as copying and pasting, on the other hand,
may not preserve character indexes.
Douglas Davidson
_______________________________________________
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