objective-c - 将 CoreData 添加到现有项目

标签 objective-c core-data

我正在尝试将 CoreData 添加到现有项目中,并且 有奇怪的错误...

我得到错误:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'

在 RootView 中有一个警告:

- (NSFetchedResultsController *)fetchedResultsController;

排队:

_fetchedResultsController.delegate = self;

它说:

warning: class 'RootViewController' does not implement the 'NSFetchedResultsControllerDelegate' protocol

有什么想法吗?

最佳答案

啊!

抱歉我问了,我只是错过了我更改了 .xcdatamodel 的名称

我只需要更改 managedObjectModel 和 persistentStoreCoordinator 中的名称

希望它能对某人有所帮助。

关于objective-c - 将 CoreData 添加到现有项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5251030/

相关文章:

ios - App Delegate - 快速加载核心数据

ios - 如何在 Core Data 中进行自定义验证(为了唯一性)?

objective-c - 为什么 UIViewController 在旋转时不填充窗口,而 UINavigationController 却填充窗口?

objective-c - 如何获取 UIView 层级索引? (即其他 subview 之间的深度)

iOS 屏幕截图失败,使用 OpenGL

ios - 无法将数据从 UITableviewController 传递到 ViewController - 不断收到 Swift 动态 Cast 类无条件错误

ios - CoreData FetchRequest 问题

ios - NSFetchedResultsController didChangeObject indexPath 为空

c++ - 如何从 ImageMagick 图像获取 c 缓冲区

objective-c - 带有 NSString 数组的 RLMObject