title: iPad app failing to write back to core data
body: <p>I have a routine that checks if the last character of a string stored in a Core Data entity is a $ and if so sets a variable 'last' to remember this and then rewrites to Core Data the string with the $ removed.</p>
  
  <p>It does not throw up any errors, and runs through the 'if' routine if the last char is $ but it does not write back to Core Data. Can anyone see what I am doing wrong?</p>
  
  <pre><code>NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Observations"];
  NSError *error = nil;
  observationList = [self.managedObjectContext executeFetchRequest:fetchRequest error:&amp;error];
  
  
  for (int loop1 = 0; loop1 &lt; [observationList count]; loop1++)
  {
  
  NSString *classCheckActual = [[observationList objectAtIndex:loop1] valueForKey: @"obsClassName"];
  NSString *last = [classCheckActual substringFromIndex:[classCheckActual length] - 1];
  NSString *classCheck = @"";
  
  if ([last isEqual: @"$"])
  {
    classCheck = [classCheckActual substringToIndex:[classCheckActual length] - 1];
    NSManagedObject *schoolObject = [[self observationList] objectAtIndex:loop1];
    [schoolObject setValue:[NSString stringWithFormat:@"%@", classCheck] forKey:@"obsClassName"];
    NSError *error;
  [context save:&amp;error];
  }
  
  }
  </code></pre>