2017-03-12 57 views

回答

1

Data(bytes:count:)需要一個UnsafeRawPointer,不是UnsafePointer。你可以簡單地傳遞&notMuch像這樣:

let notMuchNS = Data(bytes: &notMuch, count: MemoryLayout<Int>.size) 

此外,還有斯威夫特3沒有sizeof,用MemoryLayout<T>.size代替。