I apologize if this question exists already on the site posted a different way but after browsing I couldn't find anything. I have an entity in core data called category which stores categories and subcategory objects. I would like to have create a relationship between categories and sub-categories. In my app, I have the following requirements:
- sub-categories can belong to multiple categories.
- Categories can have multiple sub-categories
- A category will hold a list of its parents and children.
So really, sub-categories are just categories.
What I would like is to find a way to create my category entity to have that parent child relationship as well as a list of parents and a list of children for each category.
Can someone suggest an approach for this problem? would I need a "junction" entity? What would a fetch request look like to get a category object from the entity and populate its parents and children lists while taking advantage of the whole object graph concept (if possible)
Thank you.