• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSAttributedString - NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSAttributedString - NSDictionary
      • From: Murat Konar <email@hidden>
  • Prev by Date: Re: NSString subStringToIndex gives EXC_BAD_ACCESS
  • Next by Date: Re: NSAttributedString - NSDictionary
  • Previous by thread: Re: NSString subStringToIndex gives EXC_BAD_ACCESS
  • Next by thread: Re: NSAttributedString - NSDictionary
  • Index(es):
    • Date
    • Thread