• 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
Re: change value for key in NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: change value for key in NSDictionary


  • Subject: Re: change value for key in NSDictionary
  • From: Klaus Backert <email@hidden>
  • Date: Mon, 23 Nov 2009 14:22:01 +0100


On 23 Nov 2009, at 13:33, Ariel Feinerman wrote:

Hi,
there is instance of NSDictionary to storage graphics attributes (full
screen, buffers` sizes, resolution),
my question is can I change value for, example, key "fullscreen"
somewhere in my progam?

From the NSDictionary Class Reference:

"An instance of NSDictionary is an immutable dictionary: you establish its entries when it’s created and cannot modify them afterward. An instance of NSMutableDictionary is a mutable dictionary: you can add or delete entries at any time, and the object automatically allocates memory as needed."

Use an NSMutableDictionary and invoke e.g.

[myMutableDictionary setObject: [NSNumber numberWithBool: fstate] forKey: @"fullscreen"];

This replaces a previous entry with the same key.

Regards
Klaus

_______________________________________________

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


References: 
 >change value for key in NSDictionary (From: Ariel Feinerman <email@hidden>)

  • Prev by Date: Strings mangled on generalPasteboard
  • Next by Date: Re: drawRect method not called after several hours...
  • Previous by thread: change value for key in NSDictionary
  • Next by thread: Locale based font
  • Index(es):
    • Date
    • Thread