1

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!

1

1 Answer 1

1

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:

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your response, I have successfully created a to-many relationship in my project but I did not get what you meant by 'a reciprocal relationship in the child entity.'
The link is dead. That's why you should not use external links

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.