Re: Differences in string handling for NSString and NSAttributedString
Re: Differences in string handling for NSString and NSAttributedString
- Subject: Re: Differences in string handling for NSString and NSAttributedString
- From: Uli Kusterer <email@hidden>
- Date: Mon, 05 May 2014 18:53:59 +0200
To add an example:
Original\nString\nGoes\nHere
^8 ^15 ^20 ^25
Now I insert the first image, say just 1 character:
Original\nAString\nGoes\nHere
^8 ^16 ^21 ^26
See how all the insertion offsets would have to change? But since you already have your list of insertion offsets, you'll insert in the wrong spot, and it'll just get worse and worse with each insertion, especially the longer it is.
Backwards is not a problem:
Original\nString\nGoes\nAHere
^8 ^15 ^20 ^26
Only the end changes on the first insertion, and on the second:
Original\nString\nAGoes\nAHere
^8 ^15 ^21 ^27
Only the end and the (already-completed) last insertion location changes.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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