简体   繁体   English

在XCode 4中将NSManagedObject添加到XCDataModelD核心数据包

[英]Adding NSManagedObject INTO XCDataModelD Core Data Bundle in XCode 4

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. 作为我的项目的一部分,已经有一个现有的“ * .xcdatamodeld”核心数据包/程序包,其中包含一个“ * .xcdatamodel”(带有绿色勾号,因为它是当前版本)以及大量的.h和.m NSManagedObject文件。

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. 我想让XCode生成一个新的NSManagedObject(.h和.m文件),并 “ * .xcdatamodeld”捆绑软件中添加它但是无论我尝试哪种方式,都将文件作为捆绑软件添加到同一个组中,而不是捆绑包本身。

The ways I've tried are: 我尝试过的方法是:

1) Highlighting "*.xcdatamodeld" and selecting "Editor > Create NSManagedObject Subclass...", etc. 1)突出显示“ * .xcdatamodeld”,然后选择“编辑器>创建NSManagedObject子类...”,等等。

2) Right clicking the "*.xcdatamodeld" and selecting "Add Files to *" and choosing an NSManagedObject, etc. 2)右键单击“ * .xcdatamodeld”,然后选择“将文件添加到*”,然后选择一个NSManagedObject等。

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? 请帮忙?

as you suggested, my comment as an answer: 如您所建议,我的评论为答案:

I don't think that it's possible with XCode4 to achieve this. 我认为XCode4不可能实现这一目标。 In XCode3 this was no problem. 在XCode3中,这没有问题。 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. 我不认为这是XCode3中的预期方式,Apple现在已纠正了这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM