I get the error "This NSPersistentStoreCoordinator has no persistent stores (unknown). It cannot perform a save operation." What does this error exactly mean?
The error message says the persistent store coordinator has no persistent stores. Core Data saves data to a persistent store. If there are no persistent stores, Core Data cannot save your app's data.
My container is initialised so it should have a persistent store, right?
Are you sure the container was initialized correctly?
let container = NSPersistentCloudKitContainer(name: "TaskDataModel")
Do you have a CloudKit container named TaskDataModel?
Set a breakpoint at the start of the init function in DataController. Does the container property have the value you expect?
Step through the code line by line. Does the call to loadPersistentStores run correctly or does it generate an error?
Topic:
App & System Services
SubTopic:
iCloud
Tags: