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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to