check correct queue for managed object value access

This commit is contained in:
John Estropia
2017-04-12 19:22:18 +09:00
parent 9f3db61ff7
commit a73306fecb
10 changed files with 239 additions and 40 deletions

View File

@@ -997,6 +997,54 @@ extension Where: CustomDebugStringConvertible, CoreStoreDebugStringConvertible {
}
// MARK: - VersionLock
extension VersionLock: CustomStringConvertible, CustomDebugStringConvertible, CoreStoreDebugStringConvertible {
// MARK: CustomStringConvertible
public var description: String {
var string = "["
if self.hashesByEntityName.isEmpty {
string.append(":]")
return string
}
for (index, keyValue) in self.hashesByEntityName.enumerated() {
let data = keyValue.value
let count = data.count
let bytes = data.withUnsafeBytes { (pointer: UnsafePointer<HashElement>) in
return (0 ..< (count / MemoryLayout<HashElement>.size))
.map({ "\("0x\(String(pointer[$0], radix: 16, uppercase: false))")" })
}
string.append("\(index == 0 ? "\n" : ",\n")\"\(keyValue.key)\": [\(bytes.joined(separator: ", "))]")
}
string.indent(1)
string.append("\n]")
return string
}
// MARK: CustomDebugStringConvertible
public var debugDescription: String {
return formattedDebugDescription(self)
}
// MARK: CoreStoreDebugStringConvertible
public var coreStoreDumpString: String {
return self.description
}
}
// MARK: - XcodeDataModel
extension XcodeDataModel: CustomDebugStringConvertible, CoreStoreDebugStringConvertible {