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

spierce7

05/20/2021, 11:03 PM
What would be the proper way to call an objective c function that takes a pointer to a boolean? i.e. https://developer.apple.com/documentation/foundation/nsfilemanager/1410277-fileexistsatpath
r

russhwolf

05/21/2021, 3:22 AM
Something like this
Copy code
memScoped {
    val isDirectory = alloc<BooleanVar>()
    NSFileManager().fileExistsAtPath("some/path", isDirectory.ptr)
    val output = isDirectory.value
    // do something with output
}
s

spierce7

05/21/2021, 4:15 AM
Thanks 🙂 That seems to work.
4 Views