Save NSUndoManager transactions one at a time

I need to save the changes not only locally in Core Data, but also on the server.

My concern is that in my case, the user can perform a bunch of interactions in a short time. There is not enough time between interactions to receive a success message returned from the server. This way, I block the GUI until the following message appears - it is now - or choose a different approach.

My new approach would be to allow the user to do a lot of interaction and send the transaction to the undo stackprovided NSUndoManager, included in NSManagedObjectContext, BUT only keep / fix only the transaction, which had received a message about the successful completion . How can I move the “cursor” one at a time, fix the records one by one, although the context already contains so many unsaved changes?

0
source share
1 answer

NSUndoManagernot suitable for this task. You can tell him to undo or redo the actions, but you cannot verify these actions or selectively save data in the current undo stack.

. , , . , , , . NSManagedObjectContextWillSaveNotification / NSManagedObjectContextDidSaveNotification .

, iOS , , . , , - , , , .

+1

All Articles