如果显示 WKAlert,Watch App 在停用时终止 [英] Watch App terminates upon deactivation if WKAlert is being shown

查看:34
本文介绍了如果显示 WKAlert,Watch App 在停用时终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个手表应用程序,我注意到如果手表应用程序被停用(通过 cmd+shift+h、下腕等),调试窗口中会显示程序以退出代码结束:0".我用来在 WKInterfaceController 中显示警报的代码是:

I'm creating a watch app and I'm noticing that "Program ended with exit code: 0" is shown in the debug window if the watch app is deactivated (via cmd+shift+h, lower wrist, etc). The code I'm using to present alert in the WKInterfaceController is:

presentAlert(withTitle: alert.title, message: alert.message, preferredStyle: .alert, actions: [cancelAction, continueAction])  

我试图了解为什么如果 wkalert 在屏幕上可见并处于活动状态,手表应用程序会无错误地关闭.该应用程序的内存低于 20mb,并且在显示警报时根本不会出现峰值.在所有其他屏幕上,该应用程序只是停用.也许有解决方法?任何帮助将不胜感激.

I'm trying to understand why the watch app is closing with no error if a wkalert is visible and active on the screen. The memory of the app is under 20mb and doesn't spike at all when the alert is shown. On every other screen the app simply deactivates. Maybe there is a workaround? Any help would be appreciated.

谢谢 - 罗斯

推荐答案

我向 Apple 报告了这个错误:

I reported this bug to Apple:

总结:如果在显示模式视图时显示警报并按下主页按钮,则显示警报将使应用崩溃(代码 0).

Summary: Displaying an Alert will crash App (code 0) if Alert is presented and home button is pressed while displaying a modal view.

重现步骤:在 Apple Watch 上显示模态视图,然后显示警报.点击主页按钮或当屏幕变为空白时,应用程序将崩溃并显示代码 0.使用附加文件点击模态按钮,然后点击弹出按钮,然后在模拟器上按 cmd-shift-H 或在手表上允许屏幕变为空白.应用程序将崩溃并显示代码 0.

Steps to Reproduce: Display a modal view on Apple Watch then display an Alert. Taping Home button or when screen goes blank the App will crash with Code 0. With attached file tap the Modal button then the PopUp button then on simulator press cmd-shift-H or on watch allow screen to go blank. App will crash with Code 0.

预期结果:应用程序不应崩溃.使用 Push segue 样式而不是 Modal 显示不会导致崩溃.

Expected Results: App should not crash. Displaying with Push segue style instead of Modal will not cause crash.

实际结果:代码 0 崩溃

Actual Results: crash with Code 0

版本:iOS 3.0 和 iOS 3.1

Version: iOS 3.0 and iOS 3.1

在向 Apple 报告此错误后,他们做出了回应,但我无法提供他们要求的日志反馈:

After reporting this bug to Apple they responded but I am unable to provide the log feedback they requested:

这是关于错误 ID# 29131322 的后续行动.

This is a follow-up regarding regarding Bug ID# 29131322.

工程部要求提供以下信息以进一步调查此问题:

Engineering has requested the following information in order to further investigate this issue:

我们能否在崩溃后立即从 Watch 获得系统诊断信息?

Could we get a sysdiagnose from the Watch right after the crash?

谢谢.

请在上传之前通过更新错误报告并压缩任何捆绑文件(例如嵌套文件夹)来提供您的回复或结果.

Please provide your response or results by updating your bug report and compress any bundled files (e.g. nested folders) prior to uploading.

watchOS sysdiagnose 说明:https://developer.apple.com/services-account/download?path=/iOS/watchOS_Logs/sysdiagnose_Logging_Instructions.pdf

watchOS sysdiagnose Instructions: https://developer.apple.com/services-account/download?path=/iOS/watchOS_Logs/sysdiagnose_Logging_Instructions.pdf

watchOS 日志配置文件:https://developer.apple.com/services-account/download?path=/iOS/watchOS_Logs/watchOS_logging.mobileconfig

watchOS Logging Profile: https://developer.apple.com/services-account/download?path=/iOS/watchOS_Logs/watchOS_logging.mobileconfig

如果您能提供日志反馈并将其附加到错误报告 29131322 中,这可能有助于修复它.

If you could provide the log feedback and attach it to bug report 29131322 that might help get it fixed.

这篇关于如果显示 WKAlert,Watch App 在停用时终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆