I'm trying to call a Objective-C method that takes a NSError.
All the samples I see show,
Copy code
memScoped {
val errorRef = alloc<ObjCObjectVar<NSError?>>()
val result = function(errorRef.ptr)
}
But I get error message saying
Copy code
None of the following functions can be called with the arguments supplied:
public open fun alloc(size: Int, align: Int): NativePointed defined in kotlinx.cinterop.MemScope
public final fun alloc(size: Long, align: Int): NativePointed defined in kotlinx.cinterop.MemScope
d
Dominaezzz
06/11/2021, 2:51 PM
Looks like you're missing some imports.
m
mkrussel
06/11/2021, 3:22 PM
Thanks. Not sure why autocomplete wasn't recommending it and adding it to the imports.