mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
Notifications on save data #134
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 @mrichtsfeld on GitHub (Apr 29, 2017).
Hi John,
First of all, great library. Thanks for that great work.
I have an question regarding save notifications (NSManagedObjectContextDidSaveNotification).
I would need to collect all data after saving and store it on my server. I would normally use the notification mentioned above and get the changed objects via NSDeletedObjectsKey, NSInsertedObjectsKey, NSUpdatedObjectsKey.
Is there any such thing available in your library. I have only found the other way arround, the import. But no export so far. Did I miss it?
Maybe the commitAndWait() can allow a callback which provides this information? Like
Thanks for your answer. If you need any help regarding the implementation just let me know.
@JohnEstropia commented on GitHub (Apr 29, 2017):
You can extract these info from the transaction themselves. Check the
BaseDataTransactionmethods here: https://github.com/JohnEstropia/CoreStore/blob/develop/Sources/Transactions/BaseDataTransaction.swift#L219You can pass these objects/objectIDs to your commit completion handler and pass them to
*.fetchExisting(...).@mrichtsfeld commented on GitHub (Apr 29, 2017):
That was exactly what I was looking for. Thanks for pointing me to the right methods.