title: How to synchronise two NSManagedObjectContext
body: <p><br /> I'm working on an ipad application that use coredata. It download information on a database that is on the web, and record them in coredata. The application is based on a split view. My problem was to make the download and the record of the data in background.<br /> Here is how I've done :<br />
  - I've create an NSOperation, that does the download and the record of the data.<br />
  - This NSOperation use a different NSManagedObjectContext than the context of the appDelegate, return by this function, that is in the appDelegate :</p>
  
  <pre><code>(NSManagedObjectContext*)newContextToMainStore {
       NSPersistentStoreCoordinator *coord = nil;
       coord = [self persistentStoreCoordinator];
       NSManagedObjectContext *moc = [[NSManagedObjectContext alloc] init]; 
       [moc setPersistentStoreCoordinator:coord]; 
       return [moc autorelease];
  }
  </code></pre>
  
  <p>- I've had an observer in the NSOperation, that will call this function in the appDelegate when I save the context, to modify the context of the delegate too :</p>
  
  <pre><code>- (void)mergeChangesFromContextSaveNotification:(NSNotification*)notification {
       [[self managedObjectContext]mergeChangesFromContextDidSaveNotification:notification];
  }
  </code></pre>
  
  <p>But I've a problem, the synchronisation doesn't work, because the data on the rootViewController (that is a UITableViewController), that have a NSManagedObjectContext initialised with the context of the appDelegate and use as datasource a NSFetchedResultsController, don't actualise automatically the informations, as it normaly must do.<br />
  So I ask you : <br />What did I do wrong ? Is it the good way to use two different context and synchonise them ?</p>