-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Description
What
jsonEntity is NSManagedObject, when i got it from database, update some property.
if i commet try (self.db.mainContext as? NSManagedObjectContext)?.save(), database is not updated, when i restart my app, jsonEntity's property is not updated. i need run two save()
slove the problem.
Context
do {
jsonEntity?.content = self._gameProfileModel?.toJSONString()
try db.operation ({ (context, save) throws in
try (self.db.mainContext as? NSManagedObjectContext)?.save()
save()
})
}
catch {
print("updateGameProfileModel error \(error)")
}