Re: Keypaths
Re: Keypaths
- Subject: Re: Keypaths
- From: Niklas Saers <email@hidden>
- Date: Wed, 16 Jul 2008 12:12:16 +0200
Hi Scott & Kyle:
On Jul 16, 2008, at 2:22 AM, Scott Anguish wrote:
In fact, as long as you have modeled relationships from parent to
child you can do it, Core Data or not. Get a reference to Balbo and
Ponto and then use a keypath involving @distinctUnionOfArrays to get
to it. A bit of set theory is helpful here.
The Key-Value Coding Programming Guide has more info on this,
including a sample data relationship and what the various operators
will return when used.
http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/ArrayOperators.html#/
/apple_ref/doc/uid/20002176
I've been reading the document you refer to before posting, and
Hillegass' chapter on the subject, but I'm getting lost in the syntax.
What would be the correct way of getting the array of nodes, and the
array of names?
NSArray *nodes = [balbo
valueForKeyPath:@"@distinctUnionOfArrays.subnodes[name='Ponto
Baggins'].subnodes"] ??
NSArray *names = [balbo
valueForKeyPath:@"@distinctUnionOfArrays.subnodes[name='Ponto
Baggins'].subnodes.name"] ??
Really, it bit that confuses me is "where @property NSString *name is
'Ponto Baggins'", how do I express that in a keypath?
Cheers
Nik
_______________________________________________
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