/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
NSEntityDescription *entity = [NSEntityDescription entityForName:entityDescription inManagedObjectContext:_managedObjectContext]; [fetchRequest setEntity:entity]; NSError *error; [fetchRequest release]; [_managedObjectContext deleteObject:managedObject]; NSLog(@"%@ object deleted",entityDescription); } if (![_managedObjectContext save:&error]) { NSLog(@"Error deleting %@ - error:%@",entityDescription,error); } }