感谢您的观看:)
我使用的是 xcode 8.2.1,语言是 obj-c。
我只是创建了两个实体(照片和摄影师),在我执行 editor - create NSManagedObject Subclass
之后,生成的文件出现了错误。
一个在 Photo+CoreDataClass.m
中说“找不到 Photographer.h 文件”。
另一个在 Photographer+CoreDataClass.m
中的“找不到 Photo.h 文件”这一行。
生成的所有文件是:
Photographer+CoreDataClass.h/m,
Photo+CoreDataClass.h/m
Photographer+CoreDataProperties.h/m
Photo+CoreDataProperties.h/m
工具版本最低为 Xcode 7.3,codegen 为无/手动
谁能告诉我如何解决这个问题?
Ps,实体的关系是one Photographer对many Photo,Photo对one Photographer
最佳答案
只需重命名您的文件
Photographer+CoreDataClass.h/m,
到
Photographer.h/m
和
Photo+CoreDataClass.h/m
到
Photo.h/m
然后将其他两个类的属性复制到重命名的类中,然后删除它们。
关于ios - 在 CoreData 中使用 NSManagedObject 子类找不到 xcode8 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42024586/