title: iOS 8 CoreData Issue: recordChangeSnapshot:forObjectID:: global ID may not be temporary when recording
body: <p>I'm migrating my App from iOS 7 to iOS 8, and I've been receiving the following error in Xcode when I try to save the Core Data context. This error was not present in iOS 7 and Xcode 5.  it throws exception at below line </p>
  
  <pre><code>NSError * saveError = nil;
  if(![self.managedObjectContext save:&amp;saveError])
  { // crash on save context line.
     //error message.
  }
  </code></pre>
  
  <p>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'recordChangeSnapshot:forObjectID:: global ID may not be temporary when recording.
  I am sinking data on main thread and trying to save it in core data . 
  Below is code for managed object context in app delegate class :</p>
  
  <pre><code> - (NSManagedObjectContext *)managedObjectContext
          {
              if (_managedObjectContext != nil) {
                  return _managedObjectContext;
              }
  
              NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
              if (coordinator != nil) {
                  _managedObjectContext = [[NSManagedObjectContext alloc] init];
                  [_managedObjectContext setPersistentStoreCoordinator:coordinator];
              }
              return _managedObjectContext;
          }
  
          // Returns the managed object model for the application.
          // If the model doesn't already exist, it is created from the application's model.
          - (NSManagedObjectModel *)managedObjectModel
          {
              if (_managedObjectModel != nil) {
                  return _managedObjectModel;
              }
              NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MCRM" withExtension:@"momd"];
              _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
              return _managedObjectModel;
          }
  
          // Returns the persistent store coordinator for the application.
          // If the coordinator doesn't already exist, it is created and the application's store added to it.
  
          - (NSPersistentStoreCoordinator *)persistentStoreCoordinator
          {
              if (_persistentStoreCoordinator != nil) {
                  return _persistentStoreCoordinator;
              }
  
              NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MCRM.sqlite"];
  
              NSError *error = nil;
              _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
              if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&amp;error]) {
  
                  NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
                  abort();
              }
  
              return _persistentStoreCoordinator;
          }
  
          and it crash in data manager class :
  
          NSError *error = nil;
          if (![self.managedObjectContext save:&amp;error]) {  
               NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
           }
  </code></pre>
  
  <p>Code work fine in iOS7 and Xcode5.1 . 
  I have already tried with thread confinement (-[NSManagedObjectContext init]) to replace with [NSManagedObjectContext initWithConcurrencyType:] to NSConfinementConcurrencyType and NSMainQueueConcurrencyType with performBlockWithWait^{} code injection but still facing issue .</p>