NSKeyValueCoding tips
NSKeyValueCoding tips
- Subject: NSKeyValueCoding tips
- From: Aaron Tuller <email@hidden>
- Date: Mon, 28 Jan 2002 23:15:33 -0800
Are there are any built in objects that NSKeyValueCoding is
implemented for? Ideally I'm looking for a way to chain NSDictionary
like objects together so like I can do something like:
[someDict valueForKeyPath:@"key1.key2.key3"];
and have it do:
[[[someDict objectForKey:@"key1"] objectForKey:@"key2"] objectForKey:@"key3"]
plus all the other neat KVC stuff.
should I implement it as a category on NSDictionary? Has someone
else already done that? Am I tackling it the wrong way?
Also, I'm doing this because I parsed some XML as a property list
using OmniExpat and using the path style way to dig into the tree of
objects seems like the way to go.
Thanks for any suggestions.
Oh, also, are the path methods already made so I only need to
implement valueForKey: and magically valueForKeyPath: will parse the
path and call valueForKey:. Is that on NSObject already? I did a:
grep valueForKey *
on the headers and found nothing except in the NSKeyValueCoding.h file
-aaron