0
無法推斷出通用參數S.無法推斷出通用參數S
var buff:[Int8] = [Int8](repeating:0,count:16)
...
var addr = String(bytes: buff, encoding: String.Encoding.utf8)
無法推斷出通用參數S.無法推斷出通用參數S
var buff:[Int8] = [Int8](repeating:0,count:16)
...
var addr = String(bytes: buff, encoding: String.Encoding.utf8)
根據the documentation,buff
需要爲類型S其中S : Sequence, S.Iterator.Element == UInt8
的。所以你需要它是一組UInt8's而不是Int8的
import Foundation
var buff:[UInt8] = [UInt8](repeating:0,count:16)
var addr = String(bytes: buff, encoding: .utf8)