2016-12-01 63 views
1

我已经写了一个方法来解析InAppPurchase的收据Swift2.3,现在我将它转换为Swift3。所以我得到这个错误。任何人有想法,如何解决这个问题?无法传递不可变的值作为inout参数:隐式转换来自'UnsafePointer <UInt8>?到'UnsafePointer <UInt8>?'需要一个临时的

Receipt Parsing Error in Swift 3

+0

你可以添加一些更多的代码?像你如何宣布'P'? – Venkat

+0

var p =(data as NSData).bytes.bindMemory(to:UInt8.self,capacity:data.count) –

回答

0

尝试这样,

var p: UnsafePointer<UInt8>? = (data as NSData).bytes.bindMemory(to: UInt8.self, capacity: data.count) 
+0

我已经这样做了,它对我很有用 var p =(data as NSData).bytes.bindMemory (到:UInt8.self,容量:data.count)作为UnsafePointer ? –

相关问题