Core Data: traversing to-many relationships

  • Hi,

    I have a question regarding to-many relationships in Core Data:

    Some background:
    For my software tracking application, I have three entities: Product,
    Version and License. A product has a to-many relationship to Version
    and a Version has a to-many relationship to License. Both
    relationships have an inverse to-one relationship (every license
    belongs to exactly one version and every version belongs to exactly
    one product).

    Product <---->> Version <---->> License

    I have two table views: one showing the Products and another one that
    should show all Licenses for the selected product in the other table
    view. The array controller for the licenses is bound to the selection
    in the products array controller. The Model Key Path for the
    contentSet binding of the license array controller is set to
    versions.licenses and the Controller Key to selection.

    I'd expect core data to take the selected product, gather all its
    versions and then gather all licenses for all those versions, but
    this does not happen. Instead, I'm getting the following error:
    Exception raised during posting of notification.  Ignored.
    exception: [<_NSFaultingMutableSet 0x16660810>
    addObserver:forKeyPath:options:context:] is not supported. Key path:
    licenses. I have checked this and the licenses relationship is
    defined in the Version table.

    When I'm having the secondary table view display the versions
    belonging to the products in the first table view (the classic
    example), everything works as expected in a master/detail interface.
    So while traversing one to-many relationship works fine, it seems
    like I'm missing something to have Core Data traverse two to-many
    relationships at once.

    While I have some ideas for workarounds, I'm still wondering why this
    approach does not work.
    Thanks in advance!

previous month october 2006 next month
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today