robercoding
07/28/2024, 7:13 AMNSData to ByteArray. However when trying to call it from Swift, it doesn’t show up in the function list suggestions
This function has been set in the iOS source set and I’ve re-compiled both projects again and still not working
Could it be that I might not be thinking of something that needs to be done aside from creating the function and compiling?robercoding
07/28/2024, 7:13 AMpublic fun NSData.toByteArray(): ByteArray = ByteArray(this@toByteArray.length.toInt()).apply {
usePinned {
memcpy(it.addressOf(0), this@toByteArray.bytes, this@toByteArray.length)
}
}robercoding
07/28/2024, 7:14 AMNSData(data: imageData).toByteArray()robercoding
07/28/2024, 7:19 AMNSData specifically.. Guess it’s expected, but could it be that is not accessible specifically from NSData?robercoding
07/28/2024, 7:21 AMData type doesn’t seem to be working neitherrobercoding
07/28/2024, 7:23 AMrobercoding
07/28/2024, 7:24 AM