我正在开发一个应用程序,使用coredata.I定义NSManagedObjectContext,NsManagedObjectModel,NSPersistentStoreCoordinator在CoreDataRepository对象类而不是AppDelegate.I保存此URL使用引用CoreDataRepository.I获取低于错误。coredata错误?
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CoreDataRepository", referenced from:
objc-class-ref in HomeViewController.o
objc-class-ref in DashBoardUrlViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
有关此错误的任何想法。谢谢。
我也试过像你这样做。但我也不能成功。之后,我没有改变这些方法从我的appdelegate NSManagedObjectContext,NsManagedObjectModel,NSPersistentStoreCoordinator。我开始只从appdelegate访问托管对象上下文来编写核心数据的助手类。我认为这个问题的发生只是因为当你在其他视图控制器中使用核心数据时,它开始仅在应用程序委托中搜索方法。 AppDelegate *委托=(AppDelegate *)[[UIApplication SharedApplication]委托];这条线会帮助你。 –