Re: Keypaths
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
References: | |
| >Keypaths (From: Niklas Saers <email@hidden>) |