NSArrayController predicates with Core Data Relationships

Discussion in 'Mac Programming' started by timbos, Apr 25, 2009.

  1. timbos macrumors member

    Jan 2, 2009
    I've spent quite a bit of time on this problem today :eek:
    The Background:
    I've got a Core Data model that contains two entities. The first is a container, that has a To-Many relationship called containerItems. The second is a containee that has the inverse relationship called inContainer. Each of these entities is presented in an NSTableView (bound to an NSArrayController) that shows their name and a couple of other parameters.

    My Problem:
    I'd like to filter the list of containees based on whichever container is selected in its list. So, clicking on a particular container in the list will limit the items displayed in the containees list. Now, I can use setFilterPredicate on the containee NSArrayController to filter based on name or some other local parameter, but I can't get it to filter on the relationship.

    I'm sure that I'm missing something really obvious. :eek:
    How do I do it?

    Thanks for any insight you can provide, timbos :D
  2. Steffan Levet macrumors newbie

    Aug 31, 2011
    did you solve it?

    Just wondering if you ever solved this problem, I have a similar one and am stuck. I don't really want to code it all, I would rather use cocoa bindings if I can… Thanks for any reply

Share This Page