Cannot invoke initializer for type 'sqlite3_destructor_type'

拟墨画扇 提交于 2019-12-19 09:06:52

问题


So far the answer from Martin R has worked perfectly. But starting with Swift2 it now raises the error

Cannot invoke initializer for type 'sqlite3_destructor_type' with an argument list of type '(COpaquePointer)'

in those lines:

private let SQLITE_STATIC = sqlite3_destructor_type(COpaquePointer(bitPattern: 0))      // https://stackoverflow.com/a/26884081/1271826
private let SQLITE_TRANSIENT = sqlite3_destructor_type(COpaquePointer(bitPattern: -1))

回答1:


Taken from the github post provided courtesy of @MartinR the answer is

internal let SQLITE_STATIC = unsafeBitCast(0, sqlite3_destructor_type.self)
internal let SQLITE_TRANSIENT = unsafeBitCast(-1, sqlite3_destructor_type.self)


来源:https://stackoverflow.com/questions/30760353/cannot-invoke-initializer-for-type-sqlite3-destructor-type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!