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 protected])

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 [email protected]

Reply via email to