mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-01-12 17:32:18 +08:00
Added additional case that will trigger persistant store cleanup
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "NO"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "NO"
|
||||
buildForArchiving = "NO"
|
||||
buildForAnalyzing = "YES">
|
||||
|
||||
Reference in New Issue
Block a user