Merge branch 'prototype/Swift_3_2' into prototype/Swift_4_0

This commit is contained in:
John Rommel Estropia
2017-08-08 07:56:32 +09:00

View File

@@ -145,7 +145,7 @@ public final class XcodeDataModelSchema: DynamicSchema {
public required init(modelName: ModelVersion, modelVersionFileURL: URL) {
CoreStore.assert(
NSManagedObjectModel(contentsOf: modelVersionFileURL) != nil,
FileManager.default.fileExists(atPath: modelVersionFileURL.path),
"Could not find the \"\(modelName).mom\" version file for the model at URL \"\(modelVersionFileURL)\"."
)
@@ -164,12 +164,13 @@ public final class XcodeDataModelSchema: DynamicSchema {
return cachedRawModel
}
if let rawModel = NSManagedObjectModel(contentsOf: self.modelVersionFileURL) {
self.cachedRawModel = rawModel
return rawModel
}
CoreStore.abort("Could not create an \(cs_typeName(NSManagedObjectModel.self)) from the model at URL \"\(self.modelVersionFileURL)\".")
CoreStore.assert(
FileManager.default.fileExists(atPath: self.modelVersionFileURL.path),
"Could not find the \"\(self.modelVersion).mom\" version file for the model at URL \"\(self.modelVersionFileURL)\"."
)
let rawModel = NSManagedObjectModel(contentsOf: self.modelVersionFileURL)
self.cachedRawModel = rawModel
return rawModel
}