在 XCode 4 中将 NSManagedObject 添加到 XCDataModelD 核心数据包中
作为我的项目的一部分,已经存在一个现有的“*.xcdatamodeld”核心数据包/包,其中包含单个“*.xcdatamodel”(带有绿色勾号,因为它是当前版本)和许多 .h 和 .m NSManagedObject 文件。
我想让 XCode 生成一个新的 NSManagedObject(.h 和 .m 文件),并将其添加到“*.xcdatamodeld”包中,但是无论我尝试如何将文件添加到与捆绑包相同的组,而不是在捆绑包本身内。
我尝试过的方法是:
1)突出显示“*.xcdatamodeld”并选择“编辑器>创建NSManagedObject子类...”等
2)右键单击“*.xcdatamodeld”并选择“将文件添加到*”并选择 NSManagedObject 等。
我已经考虑过之后是否应该将文件移动到捆绑包中,但我似乎也找不到任何方法来做到这一点。
请帮忙?
There is already an existing "*.xcdatamodeld" core data bundle/package as part of my project which contains a single "*.xcdatamodel" (with a green tick because its the current version) and numerous .h and .m NSManagedObject files.
I would like to have XCode generate a new NSManagedObject (.h and .m files) and have it added with-in the "*.xcdatamodeld" bundle however whatever way I try the files get added into the same group as the bundle and not with-in the bundle itself.
The ways I've tried are:
1) Highlighting "*.xcdatamodeld" and selecting "Editor > Create NSManagedObject Subclass...", etc.
2) Right clicking the "*.xcdatamodeld" and selecting "Add Files to *" and choosing an NSManagedObject, etc.
I have considered whether I should be moving the files into the bundle afterwards but I can't seem to find any way of doing this either.
Please help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如您所建议的,我的评论作为答案:
我认为 XCode4 不可能实现这一点。在 XCode3 中这没有问题。您仍然可以手动将文件复制到包中,但无法在模型中获取这些文件。我认为这不是 XCode3 中的预期方式,Apple 现在纠正了这一点。
as you suggested, my comment as an answer:
I don't think that it's possible with XCode4 to achieve this. In XCode3 this was no problem. You could still copy the files manually to the package but there's no way to get those files within the model. I don't think that this was the intended way in XCode3 and Apple corrected that now.