我从https://github.com/jrickard/BLEBasics.git下载了此代码 并且它是用 Swift 2 编写的,当我想将它编译成 Swift 3 时,它们发生了一个错误:“模糊地使用init”
SELECT
autor.nombre as Autor,
frase.texto as frase,
group_concat(tema.nombre separator ", ") as temas
FROM tema_frase
INNER JOIN tema ON tema_frase.tema_id=tema.tema_id
INNER JOIN frase ON frase.id=tema_frase.frase_id
INNER JOIN autor ON autor.id=frase.autor_id
GROUP BY autor.nombre, frase.texto
答案 0 :(得分:1)
Data(bytes:count:)
需要UnsafeRawPointer
,而非UnsafePointer
。您可以像这样简单地传递¬Much
:
let notMuchNS = Data(bytes: ¬Much, count: MemoryLayout<Int>.size)
此外,Swift 3中没有sizeof
,而是使用MemoryLayout<T>.size
。