From b00eaf2d0be263d349e1e58b1951a4703588a3e7 Mon Sep 17 00:00:00 2001 From: John Estropia Date: Tue, 20 Oct 2015 20:54:09 +0900 Subject: [PATCH] fix warnings on watchOS --- CoreStore/Migrating/DataStack+Migration.swift | 9 ++++++--- CoreStore/Setting Up/DataStack.swift | 8 +++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CoreStore/Migrating/DataStack+Migration.swift b/CoreStore/Migrating/DataStack+Migration.swift index c323860..6e6ff37 100644 --- a/CoreStore/Migrating/DataStack+Migration.swift +++ b/CoreStore/Migrating/DataStack+Migration.swift @@ -146,7 +146,8 @@ public extension DataStack { let metadata = try NSPersistentStoreCoordinator.metadataForPersistentStoreOfType( NSSQLiteStoreType, - URL: fileURL + URL: fileURL, + options: self.optionsForSQLiteStore() ) return self.upgradeSQLiteStoreIfNeeded( @@ -265,7 +266,8 @@ public extension DataStack { metadata = try NSPersistentStoreCoordinator.metadataForPersistentStoreOfType( NSSQLiteStoreType, - URL: fileURL + URL: fileURL, + options: self.optionsForSQLiteStore() ) } catch { @@ -323,7 +325,8 @@ public extension DataStack { metadata = try NSPersistentStoreCoordinator.metadataForPersistentStoreOfType( NSSQLiteStoreType, - URL: fileURL + URL: fileURL, + options: self.optionsForSQLiteStore() ) } catch { diff --git a/CoreStore/Setting Up/DataStack.swift b/CoreStore/Setting Up/DataStack.swift index 394880e..d46dc7f 100644 --- a/CoreStore/Setting Up/DataStack.swift +++ b/CoreStore/Setting Up/DataStack.swift @@ -213,6 +213,7 @@ public final class DataStack { var store: NSPersistentStore? var storeError: NSError? + let options = self.optionsForSQLiteStore() coordinator.performBlockAndWait { do { @@ -221,7 +222,7 @@ public final class DataStack { NSSQLiteStoreType, configuration: configuration, URL: fileURL, - options: [NSSQLitePragmasOption: ["journal_mode": "WAL"]] + options: options ) } catch { @@ -293,6 +294,11 @@ public final class DataStack { return migrationQueue }() + internal func optionsForSQLiteStore() -> [String: AnyObject] { + + return [NSSQLitePragmasOption: ["journal_mode": "WAL"]] + } + internal func entityNameForEntityClass(entityClass: AnyClass) -> String? { return self.model.entityNameForClass(entityClass)