mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-11-15 13:22:12 +01:00
new auto-commit transaction methods
This commit is contained in:
1 parent
d72d1afe8b
commit
97d7a276fe
39 files changed
+3739
-3232
No files matched your search
@@ -288,10 +288,19 @@ public extension NSError {
|
||||
|
||||
internal var isCoreDataMigrationError: Bool {
|
||||
|
||||
let code = self.code
|
||||
return (code == NSPersistentStoreIncompatibleVersionHashError
|
||||
|| code == NSMigrationMissingSourceModelError
|
||||
|| code == NSMigrationError)
|
||||
&& self.domain == NSCocoaErrorDomain
|
||||
guard self.domain == CocoaError.errorDomain else {
|
||||
|
||||
return false
|
||||
}
|
||||
switch CocoaError.Code(rawValue: self.code) {
|
||||
|
||||
case CocoaError.Code.persistentStoreIncompatibleVersionHash,
|
||||
CocoaError.Code.migrationMissingSourceModel,
|
||||
CocoaError.Code.migration:
|
||||
return true
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user