简体   繁体   English

使用CoreData中的NSManagedObject子类找不到xcode8头

[英]xcode8 header not found using NSManagedObject subclass in CoreData

Thanks for having a look :) 谢谢你看看:)

I am using xcode 8.2.1 and the language is obj-c. 我使用的是xcode 8.2.1,语言是obj-c。 I simply created two entities(Photo and Photographer) and after I did editor - create NSManagedObject Subclass there went error in the files generated. 我只创建了两个实体(照片和摄影师),在我editor - create NSManagedObject Subclass ,生成的文件出错了。

One is in Photo+CoreDataClass.m saying "Photographer.h file not found". 一个是在Photo+CoreDataClass.m说“找不到Photographer.h文件”。

Another one is in Photographer+CoreDataClass.m at the line saying "Photo.h file not found". 另一个是在Photographer+CoreDataClass.m的行中说“未找到Photo.h文件”。

All the files that were generated were: 生成的所有文件都是:

Photographer+CoreDataClass.h/m,
Photo+CoreDataClass.h/m
Photographer+CoreDataProperties.h/m
Photo+CoreDataProperties.h/m

The tools version minimum is Xcode 7.3 and codegen is None/Manual 最小的工具版本是Xcode 7.3,codegen是None / Manual

Could anyone tell me how to fix this? 谁能告诉我如何解决这个问题?

Ps, the entity's relationship is that one Photographer to-many Photo, and Photo to-one Photographer Ps,实体的关系是一个摄影师对多人的照片和照片对一个摄影师

Just rename your files 只需重命名您的文件

Photographer+CoreDataClass.h/m,

to

Photographer.h/m

and

Photo+CoreDataClass.h/m

to

Photo.h/m

then copy the properties from the other two classes into the renamed ones then remove them. 然后将其他两个类的属性复制到重命名的类中,然后删除它们。

在选择.xcmod​​eld文件后,通过将Class部分设置为空来消除此错误

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

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