• 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
Re: Can a subclass of NSDictionary do this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can a subclass of NSDictionary do this?


  • Subject: Re: Can a subclass of NSDictionary do this?
  • From: Chris Hanson <email@hidden>
  • Date: Tue, 22 Jul 2003 20:30:10 -0500

On Tuesday, July 22, 2003, at 05:36 PM, James Quick wrote:
I was implementing a subclass of NSObject which contained an NSMutableDictionary.
The purpose is to support a storage container for nested NSDictionaries to allow me to
search by keys having internal structure.

You mean like key-value coding?

Look at the documentation on key-value coding, and note that dictionaries support KVC out of the box. You can say

id x = [myDictionary valueForKeyPath:@"a.b.c"];

and it will do the right thing to traverse the key path.

Key-value coding is one of the core skills you need to master to get fast with Cocoa. Once you get it, you'll wonder how you ever lived without it.

-- Chris

PS - From reading your posts, I'm getting the impression that you're doing a large amount of up-front analysis, design and specification work before actually writing any code. Check out http://c2.com/cgi/wiki?BigDesignUpFront for information on some alternative ways to develop software that can work *very* well, particularly with dynamic languages like Objective-C. I apologize if I'm misinterpreting your posts.

--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Mac OS X Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Design for Cocoa (was Re: Can a subclass of NSDictionary do this?)
      • From: Jim Rankin <email@hidden>
    • Design for Cocoa (was Re: Can a subclass of NSDictionary do this?)
      • From: Wade Tregaskis <email@hidden>
References: 
 >Can a subclass of NSDictionary do this? (From: James Quick <email@hidden>)

  • Prev by Date: Bug reports and documentation updates (was Re: Subclassing NSPort (or NSSocketPort))
  • Next by Date: Re: Bug reports and documentation updates (was Re: Subclassing NSPort (or NSSocketPort))
  • Previous by thread: Re: Can a subclass of NSDictionary do this?
  • Next by thread: Design for Cocoa (was Re: Can a subclass of NSDictionary do this?)
  • Index(es):
    • Date
    • Thread