title: Core Data, can't save context
body: <p>I'm simply trying to save a ManagedObjectContext but while I get no errors, the fetched request returns the object with none of the saved values. Consider this simple example. You have a single object, you change a property and save it. The object is there but the property is not saved. As you can see, I want only one object, and the fetch returns this one object. BTW, the code is in a simple class, not the app delegate or a view controller.</p>
  
  <p>Here is the sample code:</p>
  
  <pre><code>MyAppDelegate* delegate = [[UIApplication sharedApplication] delegate];
  
  NSManagedObjectContext* context = delegate.managedObjectContext;
  
  NSEntityDescription *myEntityDesc = [NSEntityDescription entityForName:@"MyEntity" inManagedObjectContext:context];
  
  NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
  
  [request setEntity:myEntityDesc];
  
  NSError *error = nil;
  
  NSArray *array = [context executeFetchRequest:request error:&amp;error];
  MyEntity* myEntity;
  
  if (array == nil || [array count] &lt; 1)
  {
      myEntity = [NSEntityDescription insertNewObjectForEntityForName:@"MyEntity" inManagedObjectContext:context];
  }
  else 
  {
      myEntity = [array objectAtIndex:0];
  }
  
  myEntity.BoolValue = [NSNumber numberWithBool:someBoolValue];
  myEntity.ID = @"Some ID";
  
  if ([context save:&amp;error])
  {
      NSLog(@"no error");
  }
  else 
  {
      NSLog([NSString stringWithFormat:@"found core data error: %@", [error localizedDescription]]);
  }
  </code></pre>
  
  <p>Here's the code used to retrieve the values later:</p>
  
  <pre><code>MyAppDelegate* delegate = [[UIApplication sharedApplication] delegate];
  
  NSManagedObjectContext* context = delegate.managedObjectContext;
  
  NSEntityDescription *MyEntityDesc = [NSEntityDescription entityForName:@"MyEntity" inManagedObjectContext:context];
  
  NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
  
  [request setEntity:MyEntityDesc];
  
  NSError *error = nil;
  
  NSArray *array = [context executeFetchRequest:request error:&amp;error];
  
  MyEntity* myEntity;
  
  if (array == nil || [array count] &lt; 1)
  {
      //handle error
  }
  else 
  {
      myEntity = [array objectAtIndex:0];
  }
  
  return [myEntity.BoolValue boolValue];
  </code></pre>