Enabling core data lightweight migration in Swift 3

后端 未结 5 872
野的像风
野的像风 2021-02-04 03:01

According to the articles I have read the correct way to enable core data light weight migrations is by passing options to addPersistentStoreWithType:



        
5条回答
  •  渐次进展
    2021-02-04 03:25

    In my case I make append to new description instead of replacement

    let description = NSPersistentStoreDescription()
    description.shouldInferMappingModelAutomatically = true
    description.shouldMigrateStoreAutomatically = true
    container.persistentStoreDescriptions.append(description)
    

提交回复
热议问题