Updating managed object core data

Rated 4.14/5 based on 780 customer reviews

This tutorial is presented as part of our i OS 12 Launch Party — enjoy!During app development, well before the ship date, thorough testing can help iron out the data model.An NSBatch Delete Request can be used to efficiently delete a batch of entries from a Core Data SQLite persistent store.It runs faster than deleting Core Data entities yourself on a managed object context as they operate at the SQL level in the persistent store itself.This should be easy by taking into account the following points.In other words, don’t use an NSBatch Delete Request if: Hopefully, the above extension makes it all a bit easier to implement and use batch delete requests with Core Data.It’s good to point out that Apple does have some good documentation which does quote the following related information: It clearly points out “specific entities” which makes sense looking at the above error.

It requires either passing in an instance or a collection of managed object identifiers.

This is only possible if the source of truth for your user’s data isn’t in the data store.

In all other cases, you’ll need to safeguard your user’s data.

When you encounter this step, Core Data does a few things prior to adding the store to the coordinator.

First, Core Data analyzes the store’s model version.

Leave a Reply