gpt4 book ai didi

ios - 应用程序因 UIApplicationEndBackgroundTaskError 而崩溃

转载 作者:行者123 更新时间:2023-12-04 04:32:50 25 4
gpt4 key购买 nike

上下文:我的应用是使用 SwiftUI 制作的,这是一款使用 SpriteKit 的游戏。

在我的设备上按下主页按钮时,我的应用程序遇到一个名为“UIApplicationEndBackgroundTaskError”的错误'。日志如下所示:

Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.



我尝试过设置断点,但它没有给我任何我理解的有用信息。没有日志,它只显示调试导航器。

Debug Navigator

我试图调查问题的来源。我只是添加了一些简单的打印语句。打印 Update在断点停止应用程序之前快速重复几次:
struct SceneView: UIViewRepresentable {

let bounds: CGRect


// Conformance to UIViewRepresentable
func makeUIView(context: Context) -> SKView {
SKView(frame: bounds)
}
func updateUIView(_ uiView: SKView, context: Context) {
print("Update")

let scene = Scene(size: bounds.size)
uiView.ignoresSiblingOrder = true
uiView.showsFPS = true
uiView.showsDrawCount = true
uiView.showsNodeCount = true
uiView.presentScene(scene)
}
}

  • 是什么导致了这个问题,我该如何解决这个问题?
  • 这可能是由于 SwiftUI 或我的 Xcode 测试版和 iPhone 测试版不匹配吗?
  • 最佳答案

    它在 iOS 13.2 beta 3 上是固定的,你可以在那里测试它,它应该是固定的。

    关于ios - 应用程序因 UIApplicationEndBackgroundTaskError 而崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57581382/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com