Lets say I have entities Article, Page and Category.
I want entity Article to have a relationship like this.
Article (A1) has a category (C1) for page (P1), but I want the same article (A1) to have a category (C2) for another page (P2).
How do I model this in coreData? I’m guessing maybe one of these relationships doesn’t have to implement its inverse relationship, but I’m not sure about that.
Any ideas?
Why not have the
pageentity keep track of it’scategory?You could then provide a method on
articlethat loops through all thepage‘s and returns anNSSetofcategory‘s. If this was to be used often you could consider caching the resultUpdate
articlecan have manypagesthroughcategory_pagepagecan belong to manyarticlesthroughcategory_pageI don’t think you can simply do
because you also need the
categoryinformation