无法将不可变值作为inout参数传递:来自'UnsafePointer <uint8>的隐式转换?到'UnsafePointer <uint8>?'需要一个临时的

时间:2016-12-01 11:02:12

标签: ios in-app-purchase swift3 receipt-validation

我编写了一个方法来解析InAppPurchaseSwift2.3的收据,现在我将其转换为Swift3。所以我收到了这个错误。任何人都有想法,如何解决这个问题?

Receipt Parsing Error in Swift 3

1 个答案:

答案 0 :(得分:0)

试试这个,

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