• 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
Is it a "Value" or an "Object" ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Is it a "Value" or an "Object" ?
      • From: "Luca C." <email@hidden>
  • Prev by Date: Re: NSWorkspace -launchApplication fails to launch, but no error
  • Next by Date: Re: Is it a "Value" or an "Object" ?
  • Previous by thread: Re: Threaded Server using Distributed Objects
  • Next by thread: Re: Is it a "Value" or an "Object" ?
  • Index(es):
    • Date
    • Thread