mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-13 05:45:32 +01:00
don't access iCloud's ubiquitous cache file
This commit is contained in:
@@ -364,11 +364,6 @@ public extension DataStack {
|
||||
let storeOptions = storage.dictionary(forOptions: cloudStorageOptions)
|
||||
do {
|
||||
|
||||
try FileManager.default.createDirectory(
|
||||
at: cacheFileURL.deletingLastPathComponent(),
|
||||
withIntermediateDirectories: true,
|
||||
attributes: nil
|
||||
)
|
||||
_ = try self.createPersistentStoreFromStorage(
|
||||
storage,
|
||||
finalURL: cacheFileURL,
|
||||
@@ -381,6 +376,7 @@ public extension DataStack {
|
||||
}
|
||||
catch let error as NSError where storage.cloudStorageOptions.contains(.recreateLocalStoreOnModelMismatch) && error.isCoreDataMigrationError {
|
||||
|
||||
let finalStoreOptions = storage.dictionary(forOptions: storage.cloudStorageOptions)
|
||||
let metadata = try NSPersistentStoreCoordinator.metadataForPersistentStore(
|
||||
ofType: type(of: storage).storeType,
|
||||
at: cacheFileURL,
|
||||
@@ -390,7 +386,7 @@ public extension DataStack {
|
||||
_ = try self.createPersistentStoreFromStorage(
|
||||
storage,
|
||||
finalURL: cacheFileURL,
|
||||
finalStoreOptions: storeOptions
|
||||
finalStoreOptions: finalStoreOptions
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user