Suppose I have a ‘Tree’ entity and an ‘Apple’ entity in my core data.
A tree has attributes like age and height, and to save these I just pull the tree from the context, edit the variables and save it back.
But if a tree has many apples how do I go about this? I set up a one-to-many relationship but I’m not sure how to ‘add’ apples to my tree object in the context. Like do I insert a new entity for each apple?
Thanks.
You have to create a new NSManagedObject for each Apple. Then you can add an apple to the tree using the Core Data Generated Accessors.