• 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
NSKeyValueCoding tips
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSKeyValueCoding tips
      • From: Ryan Dingman <email@hidden>
  • Prev by Date: Re: Springs and struts with splitview
  • Next by Date: Re: NSKeyValueCoding tips
  • Previous by thread: Re: initWithURL/NSattributedStrings and NSData
  • Next by thread: Re: NSKeyValueCoding tips
  • Index(es):
    • Date
    • Thread