There are a couple answers similar to this (Like deleting an entire entity). But none that have worked for me. I am just looking for simple way to fetch the object I want to delete using NSPredicate and then delete only that object. I only want to delete one object/row. It should be fairly simple code, nothing too complicated. I would provide my code but I am pretty sure it won't help because it isn't even close to being complete or even workin开发者_开发知识库g.
EntityToDelete *entity = (EntityToDelete *)[NSEntityDescription insertNewObjectForEntityForName:@"EntityToDelete" inManagedObjectContext:self.managedObjectContext];
NSError *error;
[self.managedObjectContext deleteObject:entity];
if (![self.managedObjectContext save:&error]) {
}
精彩评论