无法使用值类型扩展NSData

时间:2015-09-22 10:46:55

标签: swift2 sqlite.swift

本节不适用于swift2分支:

https://github.com/stephencelis/SQLite.swift/blob/swift-2/Documentation/Index.md#binary-data

我明白了:

Redundant conformance of 'NSData' to protocol 'Value'

Type 'UIImage' does not conform to protocol 'Value'

1 个答案:

答案 0 :(得分:0)

我使用了文档示例中的代码

extension NSData: Value {
class var declaredDatatype: String {
    return Blob.declaredDatatype
}
class func fromDatatypeValue(blobValue: Blob) -> Self {
    return self(bytes: blobValue.bytes, length: blobValue.length)
}
var datatypeValue: Blob {
    return Blob(bytes: bytes, length: length)
}

}