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

Re: Keypaths


  • Subject: Re: Keypaths
  • From: "Hamish Allan" <email@hidden>
  • Date: Tue, 15 Jul 2008 13:41:02 +0100

On Tue, Jul 15, 2008 at 11:48 AM, Niklas Saers <email@hidden> wrote:

> Hi,
> I've implemented a little tree through my class Node that contains the
> properties NSString* name and NSMutableArray *subnodes
>
> I'd love to say something like "Give me the nodes that have a grand-father
> named Balbo Baggins and father named Ponto Baggins" (should be Rosa and Polo
> Baggins) How do I express this with keypaths?

I don't believe you can. Keypaths can contain certain expressions such
as @max or @sum but not arbitrary relations.

If you were using Core Data, expressing your familial relations as
to-many relationships with inverses, it would be straightforward to
achieve the query you want (and indeed, to create a GUI for that
query). You would get an NSSet of the results which you could display
in a table with just a single column for name, or whatever other
presentation suited you best.

Hamish
_______________________________________________

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

  • Follow-Ups:
    • Re: Keypaths
      • From: "Kyle Sluder" <email@hidden>
References: 
 >Keypaths (From: Niklas Saers <email@hidden>)

  • Prev by Date: Re: Toolbar code in separate Controller?
  • Next by Date: Re: how to add modal dialog once application begin to run
  • Previous by thread: Keypaths
  • Next by thread: Re: Keypaths
  • Index(es):
    • Date
    • Thread