我一直在尝试在iOS项目的后台线程上运行Kotlin-Multiplatform库中的任务,但遇到了一些问题:
我尝试使用Kotlin-Coroutines和GCD平台库,但只能在iOS的主线程中运行任务。每当我尝试将某些东西异步发送到后台线程时,iOS应用程序会崩溃,并显示以下错误信息:“kotlin.native.IncorrectDereferenceException: illegal attempt to access non-shared com.hp.jarvis.kmm.LogFile.$saveLog$lambda-0$FUNCTION_REFERENCE$9@155a948 from other thread”。
我尝试使用Kotlin-Coroutines和GCD平台库,但只能在iOS的主线程中运行任务。每当我尝试将某些东西异步发送到后台线程时,iOS应用程序会崩溃,并显示以下错误信息:“kotlin.native.IncorrectDereferenceException: illegal attempt to access non-shared com.hp.jarvis.kmm.LogFile.$saveLog$lambda-0$FUNCTION_REFERENCE$9@155a948 from other thread”。