mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-13 23:23:29 +01:00
Discard Changes/Refresh Object #119
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mitchclay on GitHub (Jan 13, 2017).
I don't see any examples and don't see anything in the documentation about how to discard changes. Like I have an object that I use to fill out a form of a screen, I will assign some of the entered data that could be further modified on another screen but then the user selects a Cancel button, it should discard the changes and pull the original object from the persistent store.
How do I do that with this?
@JohnEstropia commented on GitHub (Jan 17, 2017):
Hi, when you call
commit()on any transaction, your changes will be saved and unless you have other flagging mechanisms in your app those changes cannot bediscarded. If you want to hold temporary changes before committing them, you can use thedataStack.beginUnsafe()transaction variant, which creates a transaction that can freely make changes and make commits on any queue.