Re: Using CFStringTransform with Attributed strings or runs, maintaining the styling of the Attributes in transformed results.
Re: Using CFStringTransform with Attributed strings or runs, maintaining the styling of the Attributes in transformed results.
- Subject: Re: Using CFStringTransform with Attributed strings or runs, maintaining the styling of the Attributes in transformed results.
- From: Douglas Davidson <email@hidden>
- Date: Mon, 20 Apr 2009 09:51:01 -0700
On Apr 19, 2009, at 1:44 PM, John Joyce wrote:
I didn't see it in the function documentation, but
is there a way for CFStringTransform to tell me the ranges of the
the transformations it has done in the returned string?!
That would certainly be nifty!
Take a look at the header comments. Notice that the range argument is
actually a range pointer, and the comments specify that "on return,
range is modified to reflect the new range corresponding to the
original range".
As far as your original question goes, using CFStringTransform on an
NSMutableAttributedString's -mutableString should do something
sensible, though I can't guarantee it will do exactly what you want.
Another option would be to iterate through the string by attribute
ranges and act on each range individually, though of course you'll
have to account for changes in length due to the transforms.
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