Skip to content

Instantly share code, notes, and snippets.

@Marlunes
Created July 9, 2013 09:03
Show Gist options
  • Save Marlunes/5955849 to your computer and use it in GitHub Desktop.
Save Marlunes/5955849 to your computer and use it in GitHub Desktop.
CORE DATA MIGRATION
//in AppDelegate.m
// Add this inside NSPersistenStoreCoordinator delegate
/* Note: NSPersistenStoreCoordinator delegate is automatically created if you create
empty application and selected "use Core Data"
*/
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES],
NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:YES],
NSInferMappingModelAutomaticallyOption
,nil];
//On the same delegate edit this:
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil URL:storeURL options:nil error:&error])
//into . . . .
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil URL:storeURL options:options error:&error])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment