title: Core Data: DELETE WHERE
body: <p>I know how to use NSPredicate to perform a SQL <code>SELECT</code>-like operation. How can I perform something like <code>DELETE WHERE</code>? Do I have to call <code>[NSManagedObjectContext deleteObject]</code> for each fetched object? Thanks</p>
  
  <pre><code>NSError *error;
  
  NSFetchRequest *request = [[NSFetchRequest alloc] init];
  [request setEntity:[NSEntityDescription entityForName:TASK_ENTITY inManagedObjectContext:managedObjectContext]];
  
  NSPredicate *predicate = [NSPredicate predicateWithFormat: @"label LIKE  %@", label];
  [request setPredicate:predicate];
  
  NSArray *array = [managedObjectContext executeFetchRequest:request error:&amp;error];
  
  [managedObjectContext deleteObject:[array objectAtIndex:0]];
  </code></pre>