-
Notifications
You must be signed in to change notification settings - Fork 100
Cannot init the PersistentContainer #179
Comments
Hello. The framework is trying to infer the Core Data model URL using the framework name itself ( I think passing your Core Data model filename (without extension) as a constructor parameter may work. If not, let me know. |
The convenience 'init' method does not passing the 'name' parameter to 'managedObjectModel' method.
And in the 'managedObjectModel' method, it using the bundle of AlecrimCoreData Framework but not the Application bundle. Should I subclass the PersistentContainer before using it? |
Same here, do you have any idea ? |
I'm going through personal problems, sorry for the delay in answering. @YLKwan: Subclassing the public init() throws {
let managedObjectModel = ...
let persistentStoreURL = ...
try super.init(managedObjectModel: managedObjectModel, storageType: .disk, persistentStoreURL: persistentStoreURL)
} @kvacquier: A future update should improve how this is done in the framework. |
try using this extension for temporary fix
|
let persistentContainer = PersistentContainer()
Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: AlecrimCoreData.PersistentContainerError.invalidManagedObjectModelURL
The text was updated successfully, but these errors were encountered: