Created
July 9, 2013 09:03
-
-
Save Marlunes/5955849 to your computer and use it in GitHub Desktop.
CORE DATA MIGRATION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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