2
0

Match the define name to its value.

This commit is contained in:
Maarten Billemont 2014-10-29 21:55:18 -04:00
parent 8615f6af5d
commit a38829c1e2

View File

@ -14,7 +14,7 @@
#define STORE_OPTIONS #define STORE_OPTIONS
#endif #endif
#define MPStoreMigrationLevelKey @"MPMigrationLevelLocalStoreKey" #define MPMigrationLevelLocalStoreKey @"MPMigrationLevelLocalStoreKey"
typedef NS_ENUM( NSInteger, MPStoreMigrationLevel ) { typedef NS_ENUM( NSInteger, MPStoreMigrationLevel ) {
MPStoreMigrationLevelV1, MPStoreMigrationLevelV1,
@ -308,7 +308,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
- (void)migrateStore { - (void)migrateStore {
MPStoreMigrationLevel migrationLevel = (signed)[[NSUserDefaults standardUserDefaults] integerForKey:MPStoreMigrationLevelKey]; MPStoreMigrationLevel migrationLevel = (signed)[[NSUserDefaults standardUserDefaults] integerForKey:MPMigrationLevelLocalStoreKey];
if (migrationLevel >= MPStoreMigrationLevelCurrent) if (migrationLevel >= MPStoreMigrationLevelCurrent)
// Local store up-to-date. // Local store up-to-date.
return; return;
@ -323,7 +323,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
return; return;
} }
[[NSUserDefaults standardUserDefaults] setInteger:MPStoreMigrationLevelCurrent forKey:MPStoreMigrationLevelKey]; [[NSUserDefaults standardUserDefaults] setInteger:MPStoreMigrationLevelCurrent forKey:MPMigrationLevelLocalStoreKey];
inf( @"Successfully migrated old to new local store." ); inf( @"Successfully migrated old to new local store." );
if (![[NSUserDefaults standardUserDefaults] synchronize]) if (![[NSUserDefaults standardUserDefaults] synchronize])
wrn( @"Couldn't synchronize after store migration." ); wrn( @"Couldn't synchronize after store migration." );