I'm trying to call a Objective-C method that takes...
# kotlin-native
m
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
Looks like you're missing some imports.
m
Thanks. Not sure why autocomplete wasn't recommending it and adding it to the imports.