Swift Realm Property '*' has been added to latest object model MIGRATION

前端 未结 1 1692
礼貌的吻别
礼貌的吻别 2020-12-19 05:04

I have added new array attribute to the RLMObject and

public class Student: RLMObject {
    dynamic var id = 0
    dynamic var name = \"\"
    dynamic var re         


        
相关标签:
1条回答
  • 2020-12-19 05:47

    You have to incremented your schemaVersion and provide a migrationBlock on your RLMRealmConfiguration. In there you can migrate tables. But you don't need that in your specific case here. The addition of properties can be handled automatically. You'll still need an empty block.

    let config = RLMRealmConfiguration.defaultConfiguration()
    config.schemaVersion = 1
    config.migrationBlock = { (migration, oldSchemaVersion) in
        // nothing to do
    }
    RLMRealmConfiguration.setDefaultConfiguration(config)
    
    0 讨论(0)
提交回复
热议问题