So I am making a todo like app. Now I have made the app I want to add a functionality where each task can have subtasks like:
Task: Book Report
Sub Tasks:
– Get Information
– Summarise and Print information
– Stick information to paper
To clarify I kind of want the core data entity to function as if it were an array.
Now I tried attempting this myself and I did it but what happened was that the when I would add a task and delete the task, the subtasks would still be there.
I am really confused on how I need to setup my entity. Any help is appreciated!
Thanks!
You need to create a to-many relationship to another entity and a reciprocal “Inverse” relationship in the child entity.
Check this out:
http://timroadley.com/2012/02/19/core-data-basics-part-4-relationships/
Inverse relationships must be created in the model editor: