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

查看:176
本文介绍了如果显示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:

摘要: 如果在显示模式视图时显示警报并按下主页按钮,则显示警报将使App(代码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:

这是有关Bug 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天全站免登陆