0

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 ^^

IronManGill
  • 7,222
  • 2
  • 31
  • 52

1 Answers1

1

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.

TheTiger
  • 13,264
  • 3
  • 57
  • 82
  • Yes, it is work.. :D thank you vakul saini.. you are an angel from heaven... hahahaha – Kendy Susantho Jul 28 '12 at 06:46
  • Ok, fine ... But remember me when you will gain the more reputation :-) .... dont forget to upvote :-) – TheTiger Jul 28 '12 at 07:19
  • haha.. fine.. vakul.. now I want to use coredata, I want to insert data, read , update also delete data... http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/coredata/Articles/cdImporting.html#//apple_ref/doc/uid/TP40003174-SW4 but I am still confuse how I use that do you have a simple coredata sample code? may you help me again? – Kendy Susantho Jul 29 '12 at 03:35
  • well, i'm also newB in CoreData Concept. But you can start from here http://developer.apple.com/library/ios/#DOCUMENTATION/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html ...AND.. http://www.raywenderlich.com/11944/core-data-tutorial-updated-for-ios-5 – TheTiger Jul 30 '12 at 06:26