【发布时间】:2015-07-26 17:07:37
【问题描述】:
我有一个最初为 iPhone 开发的应用程序,以 MapViewController 作为主屏幕,以及从 UI ActionSheet 中调用的帮助屏幕和教程屏幕。适用于 iPhone。
在 iPad 上运行时,我无法进入帮助屏幕并出现以下运行时错误:
Warning: Attempt to present <HelpViewController: 0x177076c0> on <MapViewController: 0x177d7060> which is already presenting <UIAlertController: 0x17732620>
如果我添加以下代码行
[self dismissViewControllerAnimated:YES completion:nil];
然后我确实进入了帮助屏幕,但出现以下错误:
Warning: Attempt to dismiss from view controller <MapViewController: 0x17d75660> while a presentation or dismiss is in progress!
当我退出帮助屏幕时,MapView 不会出现,但是选择一个新的 baseMap 会使它恢复活力。
因此,代码在 iPhone 上运行良好。在 iPad 上,我收到一条错误提示
1) 不要在 UIAlertController 处于活动状态时打开新视图,或者 2) 不要关闭视图,因为关闭已经在进行中...
对我来说,这似乎是一个时间问题,我已经尝试了“睡眠”语句和一些代码来提供短暂的延迟,但都没有帮助。
有人有什么想法吗?
【问题讨论】:
标签: ios objective-c iphone ipad uiviewcontroller