bypass thread checks depending on location of Field call

This commit is contained in:
John Estropia
2020-02-21 11:52:11 +09:00
parent e1b03b4a89
commit 361dba58c6
8 changed files with 52 additions and 29 deletions

View File

@@ -133,7 +133,11 @@ public struct ObjectProxy<O: CoreStoreObject> {
let keyPathString = field.keyPath
self.getValue = {
return type(of: field).read(field: field, for: rawObject) as! V
return type(of: field).read(
field: field,
for: rawObject,
bypassThreadCheck: true // May be called from NSError logs
) as! V
}
self.setValue = {
@@ -159,7 +163,11 @@ public struct ObjectProxy<O: CoreStoreObject> {
let keyPathString = field.keyPath
self.getValue = {
return type(of: field).read(field: field, for: rawObject) as! V
return type(of: field).read(
field: field,
for: rawObject,
bypassThreadCheck: true // May be called from NSError logs
) as! V
}
self.setValue = {
@@ -192,7 +200,11 @@ public struct ObjectProxy<O: CoreStoreObject> {
let keyPathString = field.keyPath
self.getValue = {
return type(of: field).read(field: field, for: rawObject) as! V
return type(of: field).read(
field: field,
for: rawObject,
bypassThreadCheck: true // May be called from NSError logs
) as! V
}
self.setValue = {