I am trying to add CoreData to an existing project and there is strange error...
I get the error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'
in RootView there is a warning in:
- (NSFetchedResultsController *)fetchedResultsController;
in line:
_fetchedResultsController.delegate = self;
and it says:
warning: class 'RootViewController' does not implement the 'NSFetchedResultsControllerDelegate' protocol
any ideas?
Get our help adding Core Data to your project So, with your existing project open, create a new project in Xcode (⇧⌘N) and select a Single View App, you can call it whatever you like as we'll be deleting it when we're done. You'll see the “Use Core Data” checkbox on the project options screen, make sure it is checked.
Use Core Data to save your application's permanent data for offline use, to cache temporary data, and to add undo functionality to your app on a single device. To sync data across multiple devices in a single iCloud account, Core Data automatically mirrors your schema to a CloudKit container.
Core Data is not a database. Core Data is a framework for managing an object graph. An object graph is nothing more than a collection of interconnected objects. The framework excels at managing complex object graphs.
argh!
sorry for even asking, I just missed that I changed the name of .xcdatamodel
I needed just to change the name in managedObjectModel and persistentStoreCoordinator
hope it'll help someone anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With