Deleting NSManagedObjects From The Database

Core Data is awesome. It is the best way to persist application state hands down. While creating/inserting objects into the database is straight forward, deleting NSManagedObjects from the database is even simpler. You simply envoke the following method on the context:

Here is how you would write a simple method you can call anytime you need to remove objects from the database:

The above method will remove all objects from the database of any given NSManagedObjectContext. Pretty straight forward, huh?

Deleting NSManagedObjects From The Database

One thought on “Deleting NSManagedObjects From The Database

Leave a Reply

Your email address will not be published. Required fields are marked *