Чтобы удалить объект из базы данных, используйте следующий метод:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
[managedObjectContext deleteObject:[userResults objectAtIndex:indexPath.row]];
[userResults removeObjectAtIndex:indexPath.row];
// Save the context.
NSError *error = nil;
if (![managedObjectContext save:&error]) {
/*
Replace this implementation with code to handle the error appropriately.
abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.
*/
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
[self.tableView reloadData];
}
Где userResults - это тип NSMutableArray, который используется для выборки данных и хранения временных значений