Added additional case that will trigger persistant store cleanup

This commit is contained in:
Stephen Vanterpool
2012-12-27 16:03:45 -08:00
parent 3fac1a83c0
commit 36d1630f8e
2 changed files with 3 additions and 2 deletions

View File

@@ -77,7 +77,8 @@ NSString * const kMagicalRecordPSCDidCompleteiCloudSetupNotification = @"kMagica
if (!store && [MagicalRecord shouldDeleteStoreOnModelMismatch])
{
if ([[error domain] isEqualToString:NSCocoaErrorDomain] && [error code] == NSPersistentStoreIncompatibleVersionHashError)
BOOL isMigrationError = [error code] == NSPersistentStoreIncompatibleVersionHashError || [error code] == NSMigrationMissingSourceModelError;
if ([[error domain] isEqualToString:NSCocoaErrorDomain] && isMigrationError)
{
// Could not open the database, so... kill it!
[[NSFileManager defaultManager] removeItemAtURL:url error:nil];

View File

@@ -8,7 +8,7 @@
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">