title: NSManagedObjectContext Saves But Does not Persist
body: <p>In a toy iOS project, I am using MagicalRecord to setup the CoreData stack in the application delegate. With the following code:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
    [MagicalRecord setupCoreDataStackWithStoreNamed:@"ToyProject.sqlite"];
    [[NSManagedObjectContext MR_defaultContext] setUndoManager:[[NSUndoManager alloc] init]];
  
  ...
  }
  </code></pre>
  
  <p>I have a subclass of NSManagedObject which I'm writing (NSRailsManagedObject--I forked NSRails and have added CoreData support), and I've given it a saveContext method:</p>
  
  <pre><code>- (void)saveContext {
    dispatch_async(dispatch_get_main_queue(), ^{
      @try {
          NSError *error = nil;
          if (![self.managedObjectContext save:&amp;error]) {
            NSLog(@"Failed to save core data: %@", [error localizedDescription]);
          } else {
            NSLog(@"\"Successfully\" saved your data.");
          }
      }
      @catch (NSException *exception) {
        NSLog(@"Couldn't save your data! Try again later :(");
      }
      @finally {
        NSLog(@"Look, I don't know what else to tell you, mang.");
      }
    });
  }
  </code></pre>
  
  <p>When I try to save subclasses of this class using this method, I receive NO errors, and the saving ostensibly succeeds. However, on the next run of the application, none of the data that was present in the previous run is there. If instead the saveContext method contains the following code, it works without a problem: </p>
  
  <pre><code>- (void)saveContext {
    [[NSManagedObjectContext MR_defaultContext] MR_save];
  }
  </code></pre>
  
  <p>Furthermore, if I hybridize the two, saving does not persist the data. </p>
  
  <pre><code>- (void)saveContext {
    dispatch_async(dispatch_get_main_queue(), ^{
      @try {
          NSError *error = nil;
          if (![[NSManagedObjectContext MR_defaultContext] save:&amp;error]) {
            NSLog(@"Failed to save core data: %@", [error localizedDescription]);
          } else {
            NSLog(@"\"Successfully\" saved your data.");
          }
      }
      @catch (NSException *exception) {
        NSLog(@"Couldn't save your data! Try again later :(");
      }
      @finally {
        NSLog(@"Look, I don't know what else to tell you, mang.");
      }
    });
  }
  </code></pre>
  
  <p>I really don't know what else to try. Can anyone point me in the right direction? </p>