assert missing classes in model

This commit is contained in:
John Rommel Estropia
2016-02-16 07:52:34 +09:00
parent 8efd6572f0
commit 57bf123fb2

View File

@@ -368,6 +368,11 @@ public final class DataStack {
for entityDescription in (self.coordinator.managedObjectModel.entitiesForConfiguration(configurationName) ?? []) {
let managedObjectClassName = entityDescription.managedObjectClassName
CoreStore.assert(
NSClassFromString(managedObjectClassName) != nil,
"The class \(typeName(managedObjectClassName)) for the entity \(typeName(entityDescription.name)) does not exist. Check if the subclass type and module name are properly configured."
)
if self.entityConfigurationsMapping[managedObjectClassName] == nil {
self.entityConfigurationsMapping[managedObjectClassName] = []