Question

I made a new xcdatamodeld with 2 entities

  1. stage, this one has a relationship many to level

  2. level, this one has many attributes and one relationship with stage

but when I create NSManagedObject subclass from that xcdatamodeld, and build my project.. 3 errors are shown in the log

like this:

Undefined symbols for architecture i386:
      "_OBJC_METACLASS_$_NSManagedObject", referenced from:
          _OBJC_METACLASS_$_Stage in Stage.o
          _OBJC_METACLASS_$_Level in Level.o
      "_OBJC_CLASS_$_NSManagedObject", referenced from:
          _OBJC_CLASS_$_Stage in Stage.o
          _OBJC_CLASS_$_Level in Level.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

anyone has had this trouble too?

How can I fix this error?

I am newbie at xcode and IOS programmer, thank you in advance ^^

Was it helpful?

Solution

It seems you haven't added CoreData.framework in your project. For this -
Select Target Go to Build Phases > Link Binary With Libraries then Click on '+' button (At below left corner), Then select the CoreData.framework then click on ADD button.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top