Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I simply created two entities(Photo and Photographer) and after I did editor - create NSManagedObject Subclass there went error in the files generated.

One is in Photo+CoreDataClass.m saying "Photographer.h file not found".

Another one is in Photographer+CoreDataClass.m at the line saying "Photo.h file not found".

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

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

like image 775
Mufasa Yang Avatar asked Feb 25 '26 22:02

Mufasa Yang


1 Answers

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.

like image 54
zizoodiesel Avatar answered Feb 27 '26 11:02

zizoodiesel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!