NSManagedObject子类重复声明 [英] NSManagedObject subclasses duplicate declaration

查看:195
本文介绍了NSManagedObject子类重复声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,当我的数据模型准备好了,我试图生成子类当我的数据模型文件打开:



编辑器 - >创建NSManaged对象子类

好的,生成两个文件,一个是类声明,另一个是属性。



但是,我立即提示我重新声明了一个已经存在的类。这是原始生成的文件的位置:
以前生成的文件



我的问题很明显:


  1. 这两个文件何时生成?
  2. 如果我需要项目导航器中的这些文件,当然还有与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:

  1. When were those two files generated?
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆