Hi all! I have a simple to-do list app which until now consisted of two entities: Project > Task. That worked fine for me but now I wanted wanted to put another Entity in-between: Project > Module > Task. My issue now is that each task I add will be added to ALL Modules instead of the one I'm currently in. Would anyone be able to push me into the right direction?
Here is my code:
Saving Projects, Modules per Project works fine. Just Task will get added to all Modules. All possible hints are much appreciated.
Thanks @Hatsushira. Where exactly would I determine the hierarchy?
Right, I forgot the DataModel. I'll write it down here as I don't know what would be the best way to copy/display it here:
Attributes: projectName id type finished
Relationships Module Task
Attributes: name isFinished hasPriority creationDate
Relationsships Project Task
Attributes: taskName priority finished
Relationships Module Project
Let me know if I can include the model in a better way!
That's what I also thought but as soon as I delete the relationship Project > Task the app crashes.
I don't really understand the error message:
Is there anything else I need to tell Xcode or CoreData when I delete the relationsship?
You should clean your build folder before building as well. Sometimes the automatically created classes for Core Data mess up.
If you created your Core Data classes with the built in tool you have to rebuild them as well. On the other hand, you have to delete projects.addToTasks lines in your code as well as they are only exist when you have an relationship Project > Task. Looking at the error message this is likely the problem. Selector is usually the word used when calling a method which doesn't exist.
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.