Re: Make an attributed string all uppercase without losing attributes? [SOLVED]
Re: Make an attributed string all uppercase without losing attributes? [SOLVED]
- Subject: Re: Make an attributed string all uppercase without losing attributes? [SOLVED]
- From: Graham Cox <email@hidden>
- Date: Sat, 9 May 2009 16:35:46 +1000
On 09/05/2009, at 2:11 PM, Graham Cox wrote:
On 09/05/2009, at 1:11 PM, Jim Correia wrote:
The documentation for -[NSMutableString
replaceCharactersInRange:withString:] is perhaps more enlightening.
"""The new characters inherit the attributes of the first replaced
character from aRange"""
Processing the string by attribute runs sounds like it should have
the
effect you are looking for.
2009-05-09 13:58:16.047 Ortelius[57577:10b] replacement range: {16,
4}, attributes = {
NSFont = "Helvetica 14.00 pt. P [] (0x1618ad80) fobj=0x00589eb0,
spc=3.89";
NSOriginalFont = "Helvetica-BoldOblique 19.00 pt. P []
(0x161b1780) fobj=0x005a1590, spc=5.28";
NSUnderline = 1;
}
Turns out I was causing the attributes to be mutated as the string was
being processed which was blowing away the attribute runs. By being a
bit more careful, the posted code does in fact do the right thing.
Thanks for pointing me in the right direction Jim!
--Graham
_______________________________________________
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