-1
我的轉換斯威夫特代碼此方法:如何將NSData轉換爲iOS Objective C中的UInt8數組?
func DATA_TO_UINT8(_ d:Data) -> Array<UInt8> {
return d.withUnsafeBytes {
[UInt8](UnsafeBufferPointer(start: $0, count: (d.count)))
}
}
,現在我希望它在目標C。
你爲什麼首先使用'Array'?這就是NSData的重點:封裝一系列字節。 –
Alexander
我得到了這段代碼的迴應,它是正確的。你能告訴我在目標c中將Data或NSData轉換爲uint8數組嗎? @Alexander –