My current method of deleting all of a certain kind of object in Core Data is to iterate over each object and delete manually, which is rather expensive.
Using the new batch updates added to Core Data this year, can it be accomplished like that?
For saving the data, first, we take manage object context that provides us a method called “delete object”. To delete an object from the database we use the “delete object” function. we need to call the “save” method to commit the change. we also remove the record from the table view.
Deleting a batch means deleting all the test results in that batch. It does not impact the baselines related to the test results in any way.
You can use . filter on the fetchedResults. Yes you can, but that's a Swift function. Using NSDelegate delegates filtering to Core Data which can be more efficient, especially on large data sets.
Unfortunately it's not possible at this time in OS X 10.10/iOS 8.
An NSBatchUpdateRequest
is only limited to update selected properties. More information on this can be found in this blog post (see the "Deleting a lot of Objects: Not a Problem" section).
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