https://kotlinlang.org logo
#ios
Title
# ios
h

Henrik

02/07/2020, 1:29 PM
KotlinByteArray to/from NSData in iOS? I have been struggling for hours trying to make my MPP code with with iOS regarding to NSData, and no examples I have found seems to work. I have a Kotlin function that takes a ByteArray as input, and another producing a ByteArray as output. This works perfectly in Java, mapping to byte[], but I have no idea how in iOS I can convert it to/from NSData that can be used in Swift. Any ideas?
a

Artyom Degtyarev [JB]

02/07/2020, 2:30 PM
h

Henrik

02/07/2020, 2:35 PM
usePinned is not defined
a

Artyom Degtyarev [JB]

02/07/2020, 2:38 PM
Are you using it in common code? It is native-specific thing, see https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.cinterop/use-pinned.html
h

Henrik

02/07/2020, 2:38 PM
Nevermind, find the import. Something compiles now - will continue trying. Thank you
a

Artyom Degtyarev [JB]

02/07/2020, 2:38 PM
Oh ok 🙂
h

Henrik

02/07/2020, 2:58 PM
Awesome, I finally got it all working. Thank you so much 🙂
385 Views