mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-22 09:29:18 +01:00
added tool to convert existing NSManagedObjectModels to the new CoreStoreSchema
This commit is contained in:
@@ -86,11 +86,15 @@ public enum ValueContainer<O: CoreStoreObject> {
|
||||
self.accessRawObject().isRunningInAllowedQueue() == true,
|
||||
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
|
||||
)
|
||||
CoreStore.assert(
|
||||
self.accessRawObject().isEditableInContext() == true,
|
||||
"Attempted to update a \(cs_typeName(O.self))'s value from outside a transaction."
|
||||
)
|
||||
self.accessRawObject()
|
||||
.setValue(
|
||||
newValue,
|
||||
forKvcKey: self.keyPath,
|
||||
willSetValue: { $0.cs_toImportableNativeType() }
|
||||
willSetValue: { ($0.cs_toImportableNativeType() as! CoreDataNativeType) }
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -163,11 +167,15 @@ public enum ValueContainer<O: CoreStoreObject> {
|
||||
self.accessRawObject().isRunningInAllowedQueue() == true,
|
||||
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
|
||||
)
|
||||
CoreStore.assert(
|
||||
self.accessRawObject().isEditableInContext() == true,
|
||||
"Attempted to update a \(cs_typeName(O.self))'s value from outside a transaction."
|
||||
)
|
||||
self.accessRawObject()
|
||||
.setValue(
|
||||
newValue,
|
||||
forKvcKey: self.keyPath,
|
||||
willSetValue: { $0?.cs_toImportableNativeType() }
|
||||
willSetValue: { ($0?.cs_toImportableNativeType() as! CoreDataNativeType?) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user