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

change value for key in NSDictionary


  • Subject: change value for key in NSDictionary
  • From: Ariel Feinerman <email@hidden>
  • Date: Mon, 23 Nov 2009 14:33:12 +0200

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?

{
NSArray *key = [NSArray arrayWithObject: @"fullscreen"];
NSArray *values = [NSArray arrayWithObject: [NSNumber numberWithBool: NO]];
NSDictionary *dic = [[NSDictionary alloc] initWithObjects: values
forKeys: keys]];
thing = [[OpenGL alloc] initWithFrame: [win frame] attribute: dic];


[dic release];
}

- (id) initWithFrame: (NSRect) frame attribute: (NSDictionary *) attribute {

/ * some code */
_attribute = [NSDictionary dictionaryWithDictionary: attribute];

return self
}

{
// get
BOOL fstate = [[_attribute valueForKey: @"fullscreen"] boolValue];
// change
?
}

methods dictionaryWithDictionary:, initWithDictionary: return
safe-changed copy or just retain them?

--
best regards
Ariel
_______________________________________________

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: change value for key in NSDictionary
      • From: Klaus Backert <email@hidden>
  • Prev by Date: drawRect method not called after several hours...
  • Next by Date: Re: drawRect method not called after several hours...
  • Previous by thread: Re: drawRect method not called after several hours...
  • Next by thread: Re: change value for key in NSDictionary
  • Index(es):
    • Date
    • Thread