If I add a new model version and then add an attribute to an entity I get a migration failure. It doesn't matter what the type of the attribute is or whether it is optional or has a default value. If I just add the new model version but don't add the attribute it works OK. I have done this sort of thing lots of times over the past 3 years without problems. Both NSMigratePersistentStoresAutomaticallyOption and NSInferMappingModelAutomaticallyOption are set to true. The error I get is shown below.
2018-02-18 12:28:51.771608+0000 Writing Shed[4105:1886727] [error] error: Illegal attempt to save to a file that was never opened. "This NSPersistentStoreCoordinator has no persistent stores (schema mismatch or migration failure). It cannot perform a save operation.". Last recorded error = Error Domain=NSCocoaErrorDomain Code=134140 "Persistent store migration failed, missing mapping model."
Does anyone know what might be wrong?