I am using CoreData
in my applcation that takes coordinates and saves them (along with other data) into the persistent store.
The application flow is like this: User pushes a button, coordinates are added every time the user moves and they are placed into the managedObjectContext
. The user presses another button and the application stops putting coordinates into the managedObjectContext
and asks the user if they want to save their data. If the user wants to save their data, I call [managedObjectContext save:&error];
and check for the error. If the user does not want to save, the coordinates just sit in the managedObjectContext
until the application is completely closed and reopened.
How can I remove those points that the user does not want to save?
[managedObjectContext rollback]
will discard any changes made to the context since the last save. If you want finer grain control add an NSUndoManager
to the context and break out the docs! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With