What do I have to do to get Core Data to automatically migrate models?

I’ve now found out that this is quite simple – once you know where to look. In my AppDelegate I set-up the NSPersistentStoreCoordinator – and you need to add some options to this to tell it to handle auto-migrate: NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil]; NSError *error; _persistentStoreCoordinator = … Read more