Skip to content

Instantly share code, notes, and snippets.

@craigmarvelley
Created June 26, 2017 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigmarvelley/bb4cc49561d48edf3a060e482fd51cd7 to your computer and use it in GitHub Desktop.
Save craigmarvelley/bb4cc49561d48edf3a060e482fd51cd7 to your computer and use it in GitHub Desktop.
// Assume we have an NSPersistentStoreCoordinator which has been initialised with our entity model, and
// an NSURL which points to our store's location on disk
NSDictionary *sourceMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:storeUrl options:options error:&error];
NSManagedObjectModel *destinationModel = coordinator.managedObjectModel;
BOOL storeIsCompatible = [destinationModel isConfiguration:nil compatibleWithStoreMetadata:sourceMetadata];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment