¡@

Home 

2014/10/15 ¤U¤È 10:14:19

iphone Programming Glossary: sourcemetadata

Detecting a Lightweight Core Data Migration

http://stackoverflow.com/questions/3025742/detecting-a-lightweight-core-data-migration

Persistent store coordinator NSURL storeUrl URL for the source store Determine if a migration is needed NSDictionary sourceMetadata NSPersistentStoreCoordinator metadataForPersistentStoreOfType NSSQLiteStoreType URL storeUrl error error NSManagedObjectModel.. managedObjectModel BOOL pscCompatibile destinationModel isConfiguration nil compatibleWithStoreMetadata sourceMetadata NSLog @ Migration needed d pscCompatibile If pscCompatibile is NO then a migration will need to occur. To examine the entity.. NO then a migration will need to occur. To examine the entity changes compare the NSStoreModelVersionHashes key in the sourceMetadata dictionary to the destinationModel entities NSSet sourceEntities NSSet setWithArray NSDictionary sourceMetadata objectForKey..

iPhone Core Data Lightweight Migration: Can't merge models

http://stackoverflow.com/questions/4745886/iphone-core-data-lightweight-migration-cant-merge-models

infer mapping model for migration Now to debug I added the following code... NSError error nil NSDictionary sourceMetadata NSPersistentStoreCoordinator metadataForPersistentStoreOfType NSSQLiteStoreType URL storeURL error error if sourceMetadata.. NSPersistentStoreCoordinator metadataForPersistentStoreOfType NSSQLiteStoreType URL storeURL error error if sourceMetadata NSLog @ sourceMetadata is nil else NSLog @ sourceMetadata is @ sourceMetadata This displays the following result... 2011.. metadataForPersistentStoreOfType NSSQLiteStoreType URL storeURL error error if sourceMetadata NSLog @ sourceMetadata is nil else NSLog @ sourceMetadata is @ sourceMetadata This displays the following result... 2011 01 20 18 18 41.018 MyApp..