title: Unable to get metadata for Core Data Persistent Store
body: <p>I am using RESTKit backed by Core Data. I am trying to detect whether or not I have a new core data model version. I have it set up to map changes automatically I just need to detect the migration to update the UI. My code is:</p>
  
  <pre><code>NSError *error;
  NSURL *sourceURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Model" ofType:@"momd"]]
  NSDictionary *sourceMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:nil URL:sourceURL error:&amp;error];
  BOOL needsMigration = ![[self managedObjectModel] isConfiguration:nil compatibleWithStoreMetadata:sourceMetadata];
  </code></pre>
  
  <p>The sourceMetadata variable is always nil and I can't seem to figure out why. The error message is not very helpful to me:</p>
  
  <p>Error Domain=NSCocoaErrorDomain Code=134000 "The operation couldn’t be completed. (Cocoa error 134000.)"</p>
  
  <p>Where am I going wrong?</p>