Is it a "Value" or an "Object" ?
Is it a "Value" or an "Object" ?
- Subject: Is it a "Value" or an "Object" ?
- From: Jerry Krinock <email@hidden>
- Date: Sat, 21 Mar 2009 06:38:15 -0700
I've never understood the difference between our use of the words
"value" and "object".
So, last week I created a little category on NSMutableDictionary which
constructs nested dictionaries. See code below for a demo of -
setValue:forKeyPath:.
Did I name it correctly, or would this method be better named -
setObject:forKeyPath: ??
Thanks,
Jerry
int main(int argc, const char *argv[]) {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ;
NSMutableDictionary* md = [NSMutableDictionary dictionary] ;
[md setValue:@"red"
forKeyPath:@"meals.lunch.fruit.color"] ;
[md setValue:@"white"
forKeyPath:@"meals.lunch.cheese.color"] ;
NSLog(@"%@", md) ;
[pool release] ;
return 0 ;
}
*** Console Output ***
[Session started at 2009-03-21 06:30:02 -0700.]
2009-03-21 06:30:02.402 LittleTestTool[89792:10b] {
meals = {
lunch = {
cheese = {
color = white;
};
fruit = {
color = red;
};
};
};
}
_______________________________________________
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