refactor some internal methods. renamed addInMemoryStore to addInMemoryStoreAndWait to reflect synchronicity.

This commit is contained in:
John Rommel Estropia
2015-07-25 23:05:48 +09:00
parent edc51de030
commit 106789d592
9 changed files with 173 additions and 44 deletions

View File

@@ -0,0 +1,38 @@
//
// NSFileManager+Setup.swift
// CoreStore
//
// Created by John Rommel Estropia on 2015/07/19.
// Copyright © 2015 John Rommel Estropia. All rights reserved.
//
import Foundation
// MARK: - NSFileManager
internal extension NSFileManager {
// MARK: Internal
internal func removeSQLiteStoreAtURL(fileURL: NSURL) {
do {
try self.removeItemAtURL(fileURL)
}
catch _ { }
do {
try self.removeItemAtPath(fileURL.path!.stringByAppendingString("-shm"))
}
catch _ { }
do {
try self.removeItemAtPath(fileURL.path!.stringByAppendingString("-wal"))
}
catch _ { }
}
}