linker command failed with exit code 1 (use -v to see invocation)

Undefined symbols for architecture arm64:

  "_OBJC_CLASS_$_NSManagedObjectContext", referenced from:

      objc-class-ref in AppDelegate.o

  "_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from:

      objc-class-ref in AppDelegate.o

  "_OBJC_CLASS_$_NSManagedObjectModel", referenced from:

      objc-class-ref in AppDelegate.o

  "_NSSQLiteStoreType", referenced from:

      -[AppDelegate persistentStoreCoordinator] in AppDelegate.o

ld: symbol(s) not found for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

这个问题我解决的办法是添加CoreData.framework包,并在相应的.m文件中添加

#import <CoreData/CoreData.h>即可。

http://*.com/questions/8359427/xcode-4-2-nsmanagedobject-context-build-failed