重新添加xcdatamodel到构建设置 [英] Re-add the xcdatamodel to the Build Settings
问题描述
在我忙于尝试此问题,我不小心删除了xcdatamodel包。
我发现最近有这个问题,其中提到以下内容:
由于某些原因,xdatamodel从构建设置中删除。我添加了它,它工作。
我试着做他做的,但我不知道在哪里
我重新创建了包,但是当我尝试设置属性值时,我得到 + entityForName:找不到名为EN ...
我知道的只有;它的确有效,直到我开始愚弄与不教程的属性和东西。
其他问题是,当你添加一个文件到项目,它不一定添加到当前目标。您可以在一个项目中有多个目标,并且可以添加未编译的文件(例如开发人员文档),因此可以添加一个文件,但是只能坐在那里而不能构建。
如果您在Xcode中选择文件并打开右侧的实用程序窗格,则会显示一个显示目标成员资格的部分。它看起来像这样:
这表明文件属于项目 momdecTests
,但不是项目 momdec
。请确保您在此处选中了您的应用目标。
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.
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.
这篇关于重新添加xcdatamodel到构建设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!