views:

248

answers:

2

Hello

I've got three entities in my application so far: tag, feed and story

A tag has got a to-many relationship to feeds and feeds has got a to-many relationship to story.

I've got an NSArrayController for each entity, one named tags, one named feeds and one named stories. They all share the same 'managedObjectContext' which they get from the file's owner. the content set of the AC named feeds is bound to 'tags' controler key: selection, key path: feeds

I want the content set of the third array to be bound to all of the stories in all of the feeds in the selected tag: i tried to use the key path: "@unionOfArrays.stories" but couldn't get it to work.

Any idea how i would go about this?

A: 

You can try @distinctUnionOfSets.stories. All Core Data 1-n relationships are implemented as sets.

Diederik Hoogenboom
Thanks for taking time to help me out :)When i bind the contentSet of my AC controlling story entities to controller key 'arrangedObjects' and key path '@distinctUnionOfSets.stories' the compiler tells me to use the contentArray but when I bind it to the contentArray it says "<FeedArrayController: 0x17d230>[entity: feed, number of selected objects: 1] (from bound object <StoryArrayController: 0x17c420>[entity: story, number of selected objects: 0](null)): [<_NSControllerArrayProxy 0x17cde0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key distinctUnionOfSets."
Mads H
+2  A: 
John Gallagher
Yay, got it working now. Thanks a lot :)
Mads H
Now that you've got it working, could you please upvote my answer and/or accept it? Thanks.
John Gallagher
I'm sorry but I'm not allowed to give you +1 because apparently I haven't got enough reputation
Mads H
Sorry! Duh. I should have thought about this before posting the comment. Thanks for accepting the answer.
John Gallagher