Search code examples
iphonecore-dataentity-relationshiprelationship

iPhone Core Data Recursive relationship


I try to create a recursive relationship in core data. I have a Model "MenuItem" that can contains some other "MenuItem", it reference itself in a too-many-relationship. To do that a created a "children" too-many-relationship, and a "parent" relationship. The both relationship are inverse of the other one. But when i try to compile a get this error :

ld: duplicate symbol _OBJC_METACLASS_$_MenuItem in /Users/mlecomte/Dropbox/Projects/iPhone/Emakina/Electrabel/XCode/build/Electrabel.build/Debug-iphoneos/Electrabel.build/Objects-normal/armv7/MenuItem-FA48D8B96953EA4D.o and /Users/mlecomte/Dropbox/Projects/iPhone/Emakina/Electrabel/XCode/build/Electrabel.build/Debug-iphoneos/Electrabel.build/Objects-normal/armv7/MenuItem-FD173522ABE19C3D.o

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

EDIT: I forget to say that i generated the Object Managed class of the menuitem.

when i delete the relationship or when i dont generate the Object Managed class for menuItem everything compile juste fine.

I will thank you in advance for your help.

Regards,


Solution

  • I seems that you have 2 MenuItem classes. Delete all of them and recreate them from menu. And also delete the old app and then rebuild.