• 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
NSDictionary valueForKeyPath:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDictionary valueForKeyPath:


  • Subject: NSDictionary valueForKeyPath:
  • From: "email@hidden" <email@hidden>
  • Date: Sun, 14 Dec 2008 15:21:26 +0000

I was surprised to learn that a hierarchy of NSDictionary objects can be queried with valueForKeyPath:

NSDictionary *dict0 = [NSDictionary dictionaryWithObjectsAndKeys:@"got me!", @"2", nil];
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:dict0, @"1", nil];
NSLog([dict valueForKeyPath:@"1.2"]);


This is powerful functionality.

Am I blind (again), or is this fact omitted from the docs? Or is it implicit from the nature of KVC?
Googling turns up references to the same functionality in WebObjects.


Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




_______________________________________________

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: NSDictionary valueForKeyPath:
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Notification Sent When Window Is Ordered Back?
  • Next by Date: Re: Notification Sent When Window Is Ordered Back?
  • Previous by thread: Re: Notification Sent When Window Is Ordered Back?
  • Next by thread: Re: NSDictionary valueForKeyPath:
  • Index(es):
    • Date
    • Thread