I'm trying to use the `updateApplicationContext()`...
# kotlin-native
c
I'm trying to use the
updateApplicationContext()
function from
WatchConnectivity
on iOS. The function
throws
which seems to translate to a parameter
error
of type
kotlinx.cinterop.CPointer<kotlinx.cinterop.ObjCObjectVar<platform.Foundation.NSError?>>?
, does somebody know how I can get this error if the function throws?
m
Maybe something like this?
Copy code
memScoped {
    val error = alloc<CFErrorRefVar>()
    val key = SecKeyCreateRandomKey(attributes, error.ptr)
    (CFBridgingRelease(error.value) as? NSError)?.let {
        println("ERROR: ${it.debugDescription}")
    }
}