Hi there, I'm Marcos!

Back

Deleting a CoreData object

The only thing you need to delete a CoreData object is the viewContext and the object itself. With those values you can execute the following:

viewContext.delete(yourObject)

do {
  try viewContext.save()
} catch {
  // handle your error here
}