Weird Errors When Adding a Core Data Entity

So I was making a relationship between two entities in my data model and got a good ways in when I tried to run it and got a bunch of weird errors. Did I do something wrong to make this happen and if so what do I need to do? I've troubleshooted enough to realize that it happens as soon as I create a new entity. These are the errors.

Answered by Zimmie in 717808022

The problem is you have named your new entity "List". SwiftUI also has a construct named "List" which you are trying to use. The compiler is confused, and is trying to use the entity in your UI.

Change the name of your entity, clean your build folder, and rebuild. I would use something like RecipeCollection, as I mentioned in my edit in your other thread. Depending on how exactly you want it to work, "RecipeFolder" or "RecipeTag" might be better names.

Not sure if this helps, but here's the data model

From these errors, the compiler seems very confused. Probably need to see the call site(s) to give any suggestions.

Is there something that needs to be added in the persistence file when making a relationship??

Accepted Answer

The problem is you have named your new entity "List". SwiftUI also has a construct named "List" which you are trying to use. The compiler is confused, and is trying to use the entity in your UI.

Change the name of your entity, clean your build folder, and rebuild. I would use something like RecipeCollection, as I mentioned in my edit in your other thread. Depending on how exactly you want it to work, "RecipeFolder" or "RecipeTag" might be better names.

Weird Errors When Adding a Core Data Entity
 
 
Q