【问题标题】:In Xcode 14 & iOS 16 purple warnings starting with 'This method should not be called on the main thread as it may lead to UI unresponsiveness.'在 Xcode 14 和 iOS 16 紫色警告中,以\'此方法不应在主线程上调用,因为它可能导致 UI 无响应。\'
【发布时间】:2022-11-11 13:58:31
【问题描述】:

在 WKWebView 中加载 URL 时会导致安全警告,之后应用程序会崩溃。

UIApplicationMain 中的警告 - This method should not be called on the main thread as it may lead to UI unresponsiveness.

如何解决这个问题?有没有人面临同样的问题并解决它?

【问题讨论】:

  • 有同样的问题,似乎是苹果错误

标签: wkwebview ios16 xcode14


【解决方案1】:

您可以尝试在块 DispatchQueue.main.async { } 中调用此方法

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-01-06
    • 1970-01-01
    • 2022-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-06
    相关资源
    最近更新 更多