Re-add the xcdatamodel to the Build Settings

做~自己de王妃 提交于 2019-12-11 19:32:28

问题


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.


回答1:


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:

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.



来源:https://stackoverflow.com/questions/19389191/re-add-the-xcdatamodel-to-the-build-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!