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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to