change value for key in NSDictionary
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