Geo*_*e_E 8 ios appdelegate sprite-kit swift swiftui
上下文:我的应用是使用SwiftUI制作的,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.
我已经尝试过创建断点,但是它并没有提供我所了解的任何有用信息。没有日志,仅显示“调试导航器”。
我试图调查问题的出处。我只是添加了一些简单的打印语句。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)
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3550 次 |
| 最近记录: |