NSManagedObject子类重复声明 [英] NSManagedObject subclasses duplicate declaration
问题描述
所以,当我的数据模型准备好了,我试图生成子类当我的数据模型文件打开:
编辑器 - >创建NSManaged对象子类
好的,生成两个文件,一个是类声明,另一个是属性。
但是,我立即提示我重新声明了一个已经存在的类。这是原始生成的文件的位置:
以前生成的文件
我的问题很明显:
- 这两个文件何时生成?
- 如果我需要项目导航器中的这些文件,当然还有与ViewController相同的文件夹,该怎么办?
Find
您正在生成的文件已经由Xcode为您生成,因此得到重复的声明。 此答案中的详细信息。
So, when my data model is ready, I tried to generate the subclasses when my data model file is open:
Editor -> Create NSManaged Object Subclasses
Okay, two files are generated, one is class declaration, the other is the property.
However, I was immediately prompted that I did a redeclaration of a class that already exists. This is where the original generated files are: previously generated files
My question is obvious:
- When were those two files generated?
- What to do if I want those files in my project navigator, and, of course, the same folder as my ViewController?
You are generating files which have already been generated for you by Xcode and thus get duplicate declarations.
Find detailes in this answer.
这篇关于NSManagedObject子类重复声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!