Hi,

I can't find any mention of if in the documentation but I need to know: how 
safe is it to use the dictionary returned from 
"attributesAtIndex:effectiveRange" after I've made changes to the attributed 
string? More specifically, I'm worried that maybe what I'm getting (at least 
sometimes) is not a copy of the dictionary at that point but the actual mutable 
dictionary off the string data structure and that it may be changed when I'm 
making changes to the attributed string.

For example:

NSDictionary* myAttributes;

[myMutableAttributedString addAttribute:@"my attribute" value:[NSNumber 
numberWithInt:10] range:NSMakeRange(0,10)];

myAttributes=[myMutableAttributedString attributesAtIndex:4 
effectiveRange:NULL];

[myMutableAttributedString addAttribute:@"my attribute" value:[NSNumber 
numberWithInt:20] range:NSMakeRange(0,10)];

anAttribute=[myAttributes attributesAtIndex:4 effectiveRange:NULL];

Is anAttribute guaranteed to be equal to 10?

TIA


Eyal Redler
------------------------------------------------------------------------------------------------
"If Uri Geller bends spoons with divine powers, then he's doing it the hard 
way."
--James Randi
www.eyalredler.com


_______________________________________________

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