Discard Changes/Refresh Object #119

Closed
opened 2025-12-29 18:23:12 +01:00 by adam · 1 comment
Owner

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?

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?
adam added the question label 2025-12-29 18:23:12 +01:00
adam closed this issue 2025-12-29 18:23:12 +01:00
Author
Owner

@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 be discarded. If you want to hold temporary changes before committing them, you can use the dataStack.beginUnsafe() transaction variant, which creates a transaction that can freely make changes and make commits on any queue.

@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 be `discarded`. If you want to hold temporary changes before committing them, you can use the `dataStack.beginUnsafe()` transaction variant, which creates a transaction that can freely make changes and make commits on any queue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore-JohnEstropia#119