NSAttributedString - NSDictionary
NSAttributedString - NSDictionary
- Subject: NSAttributedString - NSDictionary
- From: "Erfan Aleemullah" <email@hidden>
- Date: Fri, 9 Nov 2007 18:02:53 -0500
Hi All,
Im struggling to understand how *NSDictionary* works - more so with the
command listed below.
I am trying to output a large multicolored (color settings are user defined
and stored separately) NSString and I can't figure out how NSDictionary
stores and accesses its values when called up such that the right values are
picked up and coloured as per the user.
I'm using
*
*
initithString:attributes:
Returns an NSAttributedString object initialized with a given string and
attributes.
- (id)initithString:(
NSString<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/c_ref/NSString>
*)*aString* attributes:(
NSDictionary<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSDictionary>
*)*attributes*
Do i use a separate dictionary describing the user color settings for
selected words or can one dictionary support this? For instance, I dont
think using the code below is sufficient for 3 different color settings for
3 different words as i feel newer settings overwrite the older ones. I am
currently using one dictionary to store colour values.
*
[dictionary setObject:[some color] forKey:NSForegroundColorAttributeName];
[dictionary setObject:[some color] forKey:NSBackgroundColorAttributeName];
*
Any help is much appreciated.
_______________________________________________
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