Question

While I was busy trying out stuff for this question, I accidently removed the xcdatamodel-package.

I found out that recently there was this question which mentioned the following:

For some reason, the xdatamodel was removed from the build settings. I added it back in and it worked.

I tried doing what he did, but I don't know where to start.

I recreated the package, but when I try to set an attribute value, I get +entityForName: could not locate an entity named 'EN'...

All I know is; it did work until I started fooling around with not-tutorial-attributes and stuff.

Was it helpful?

Solution

What they're getting at in that other question is that when you add a file to a project, it's not necessarily added to the current target. You can have multiple targets in a project, and you can add files that don't get compiled (e.g. developer documentation), so it's possible to add a file but then have it just sit there and not get built.

If you select the file in Xcode and open up the Utilities pane on the right, there's a section that shows target membership. It looks like this:

target membership

This one shows that the file belongs to the project momdecTests but not to the project momdec. Make sure your app target is checked here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top