I am getting memory leak during migration using Realm (v1.0.2). My code looks like that:
let config = Realm.Configuration(
schemaVersion: 1,
migrationBlock: { migration, oldSchemaVersion in
// We haven’t migrated anything yet, so oldSchemaVersion == 0
if (oldSchemaVersion < 1) {
migration.enumerate(MyClassRealm.className(), { (oldObject, newObject) in
newObject!["remoteId"] = 0
newObject!["deleted"] = false
newObject!["dirty"] = true
newObject!["updated"] = 0
})
}
})
// Tell Realm to use this new configuration object for the default Realm
Realm.Configuration.defaultConfiguration = config
// Now that we've told Realm how to handle the schema change, opening the file
// will automatically perform the migration
do {
let _ = try Realm()
} catch {
TSLog.error(error as NSError)
}
Stack trace:
Do you have any idea what is wrong?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)