I'm trying to capture an error from AvPlayer and c...
# ios
f
I'm trying to capture an error from AvPlayer and can't seem to find the right alloc function All of the examples I've use alloc with no args, but I can only find overridden (int,int) (Long, Int). Can anyone point me in the right direction here?
memScoped {
val error = alloc<ObjCObjectVar<NSError?>>()
val result = objcFun(params, error.ptr)
val nsError = error.value
if (nsError != null) {
// throw exception, return error type, etc.
}
// return result, success type, etc.
}
duh import kotlinx.cinterop.alloc
f
Love that snippet, thanks for sharing 🙂