title: deleteObject deletes but leaves empty rows in the sqlite3 database?
body: <p>I need to delete the selected row of the database shown in <code>updatePick</code>, but can't seem to get the <code>managedObject</code> that's supposed to be in the <code>[context deleteObject:managedObject];</code> line correct. Here's the deleteUpdate method:</p>
  
  <pre><code>-(void)deleteUpdate {
      NSLog(@"35-Delete pressed.");
      NSManagedObjectContext *context = [self managedObjectContext];
      NSEntityDescription *updateEntity = [NSEntityDescription entityForName:@"Updates" inManagedObjectContext:context];
  
      NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
      [fetchRequest setEntity:updateEntity];
  
      NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(dateGains = %@)", [arrayNSDateGains objectAtIndex:updatePick]];
      [fetchRequest setPredicate:predicate];
  
      NSArray *gains = [context executeFetchRequest:fetchRequest error:nil];
  
      for (updateGains in gains) {
          [context deleteObject:updateGains];
      }
      [self saveContext];
  }
  </code></pre>
  
  <p>This manages to delete the contents of the row in the database (YEAH), except, it leaves an empty row and three residual elements: primary key (Z_PK), and two integers (Z_ENT) &amp; (Z_OPT). The empty row causes errors elsewhere. What am I missing here?</p>