Realm Migration doesn't work

后端 未结 8 1182
天涯浪人
天涯浪人 2020-12-28 17:16
    let config = Realm.Configuration(
        // Set the new schema version. This must be greater than the previously used
        // version (if you\'ve never set a         


        
8条回答
  •  既然无缘
    2020-12-28 17:49

    Make sure you don't try to instantiate instance of Realm() before migration config is set in application(application:didFinishLaunchingWithOptions:). When it crashes check execution stack to find which instance raised exception. I had the same error, in my case Realm instance in one of my view controllers were instantiated before migration block was set.

    Good luck

提交回复
热议问题