Core Data lightweight migration: Can't find or automatically infer mapping model for migration

So I created a new version of my data model, and made a previously optional field non-optional (giving it a default value). According to the documentation, this should mean my migration is eligible for lightweight, automatic migration.

I also added options that allow this when I open the store, also per the documentation:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:

[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,

[NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];

When my app is starting, however, I get the following error:

"Can't find or automatically infer mapping model for migration".

Does anyone know what the problem here could be? Any help is appreciated... thanks!

7
задан Ashley Mills 14 August 2018 в 13:42
поделиться