FWIW, here's the code that actually throws the error from the above model.
var sharedModelContainer: ModelContainer = {
let schema = Schema([
foo.self,
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
do {
let container = try ModelContainer(for: schema, configurations: [modelConfiguration])
container.mainContext.autosaveEnabled = true
print("DragAlert.sharedModelContainer initialized.")
return container
} catch {
fatalError("Could not create ModelContainer: \(error)")
}
}()
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: