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

Michael Clancy

10/25/2021, 4:59 PM
Hi there, have had a look around and can’t seem to find the recommended solution to this. If I am calling an obj-C function from native, and this function returns a List<*>, (due to limited generics in obj-C), how might I cast to a DoubleArray if I know the type in the collection?
r

rnett

10/25/2021, 5:20 PM
Probably
(x as List<Double>).toDoubleArray()
You can't cast a list directly to an array
m

Michael Clancy

10/26/2021, 10:20 AM
Will have a go at that thanks!
4 Views