Is it possible to traverse dictionaries and arrays using KVC?
Is it possible to traverse dictionaries and arrays using KVC?
- Subject: Is it possible to traverse dictionaries and arrays using KVC?
- From: Tito Ciuro <email@hidden>
- Date: Tue, 16 Aug 2011 11:03:30 -0700
Hello,
In KVC, the setValue:forKeyPath: method is super handy to set values in deep hierarchies. I was wondering if it would be possible to access array elements using KVC. I haven't seen any reference about it in the docs, so I was wondering if it's at all possible. Example:
NSDictionary (characters)
|-- NSDictionary (friends)
|-- NSMutableArray (jim, sarah, peter)
Using a key path such as characters.friends.usa[2] (or something similar), could I access peter?
Traversing it manually isn't a problem, but if KVC can do it for me, then great!
Thanks,
-- Tito
_______________________________________________
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