Core Data: default state of autocommit
-
12-06-2021 - |
Question
I'm wondering what is default state of autocommmit in iOS Core Data and if it's possible to change it. I couldn't find any mentions in official documentation. On SO I've found only this It's said, that native sqlite framework has low-level function to determine the state of autocommit. Maybe it's possible to improve a performance by unsetting autocommit if it's set by default?
La solution
Core Data does not have auto-commit. You must save your context. Now, if you are using UIManagedDocument, it's different... because it does have auto-save, but you still have to tell it that it has dirty data so it knows to auto-save.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow