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
.commitAndWait( { (deleted, inserted, updated) => Void in
// do my sync/data collect stuff here
})
Thanks for your answer. If you need any help regarding the implementation just let me know.
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
.commitAndWait( { (deleted, inserted, updated) => Void in
// do my sync/data collect stuff here
})
Thanks for your answer. If you need any help regarding the implementation just let me know.
adam
added the question label 2025-12-29 18:23:25 +01:00
@JohnEstropia commented on GitHub (Apr 29, 2017):
You can extract these info from the transaction themselves. Check the `BaseDataTransaction` methods here: https://github.com/JohnEstropia/CoreStore/blob/develop/Sources/Transactions/BaseDataTransaction.swift#L219
You can pass these objects/objectIDs to your commit completion handler and pass them to `*.fetchExisting(...)`.
```swift
CoreStore.beginAsynchronous { (transaction) in
// ...
let insertedObjects = transaction.insertedObjects()
transaction.commit { (result) in
// ...
let insertedObjects = CoreStore.fetchExisting(insertedObjects)
// ...
}
}
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.