https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
n

natario1

10/01/2023, 6:23 PM
How does cinterop handle objective C pointers? I’m trying to interact with this API: https://developer.apple.com/documentation/avfaudio/avaudiosession/1616557-availableinputs?language=objc In Kotlin code, it returns a
List<Any?>
. It’s not clear to me how to map the
Any?
values to `AVAudioSessionPortDescription`s. For example, have some experience with C interop, but
AVAudioSessionPortDescription
is not even a CPointed (nor there’s any *Var type). Has anyone dealt with this before?
Turns out that a simple cast on list items works:
Copy code
it as AVAudioSessionPortDescription
I wonder why cinterop infers the type to be Any? then.