简体   繁体   English

在演示或解雇过程中警告尝试从视图控制器解雇

[英]warning attempt to dismiss from view controller while a presentation or dismiss is in progress

Steps to reproduce - 重现步骤 -

  1. Open Modal view controller on tap of button of Root View controller. 点击根视图控制器按钮,打开模态视图控制器。
  2. In Modal view controller - On button, create segue to show popover view controller. 在“模态视图控制器-打开”按钮中,创建序列以显示弹出视图控制器。
  3. Tap on button to see Popover view controller. 点击按钮以查看Popover视图控制器。
  4. Now multiple taps on screen to dismiss the popover view controller, it directly redirects to Rootview controller.(dismissing the Modal view controller). 现在,在屏幕上多次轻击以关闭弹出视图控制器,它直接重定向到Rootview控制器。(关闭了Modal视图控制器)。

Another approach - 另一种方法-

  1. Create IBAction to show popover view controller. 创建IBAction以显示弹出视图控制器。
  2. Tap on button to see Popover view controller. 点击按钮以查看Popover视图控制器。
  3. This time it just dismiss the pop view controller. 这次,它只是关闭了弹出视图控制器。 (Not redirecting to RootView controller) (不重定向到RootView控制器)

Why this weird behavior when your showing Popover view controller in two different ways? 当您以两种不同的方式显示Popover视图控制器时,为什么会有这种奇怪的行为? I am working on already developed big project and now its not possible for me to go ahead with second approach. 我正在从事已经开发的大型项目,现在无法继续第二种方法。 Please help me to find out the better way to resolve this. 请帮助我找出解决此问题的更好方法。

You will need to create a delegate method in your Modal view controller. 您将需要在Modal视图控制器中创建一个委托方法。 After your popover view controller dismissed, then call your Modal view controller delegate method to dismiss as well. 弹出窗口视图控制器关闭后,再调用Modal视图控制器委托方法也将其关闭。

[self dismissViewControllerAnimated:YES completion:^{
    ModalViewControllerDelegate.dismissView;
}];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在演示或关闭过程中尝试从视图控制器(UIModalViewController)关闭 - Attempt to dismiss from view controller (UIModalViewController) while a presentation or dismiss is in progress 得到:“在进行演示或解散时尝试从视图控制器中解散” - Getting : “Attempt to dismiss from view controller while a presentation or dismiss is in progress” 在演示或解雇过程中尝试从视图控制器中解除 - Attempt to dismiss from view controller while a presentation or dismiss is in progress iOS警告:在进行演示或关闭时尝试从视图控制器中关闭 - iOS Warning: Attempt to dismiss from view controller while a presentation or dismiss is in progress 控制台警告:在进行演示或关闭时尝试从视图控制器中关闭 - Console warning: Attempt to dismiss from view controller while a presentation or dismiss is in progress 警告:尝试从视图控制器中退出 <UINavigationController: 0xb359a20> 在进行演示或解雇时 - Warning: Attempt to dismiss from view controller <UINavigationController: 0xb359a20> while a presentation or dismiss is in progress UISearchController-警告:在进行演示或关闭时尝试从视图控制器关闭 - UISearchController - Warning: Attempt to dismiss from view controller while a presentation or dismiss is in progress iOS 7错误警告:尝试从视图控制器中解除 <UINavigationController: 0x1568db40> 正在进行演示或解雇 - iOS 7 error Warning: Attempt to dismiss from view controller <UINavigationController: 0x1568db40> while a presentation or dismiss is in progress 试图从视图控制器中解雇 <UINavigationController: 0x717f0f0> 在进行演示或解雇时 - Attempt to dismiss from view controller <UINavigationController: 0x717f0f0> while a presentation or dismiss is in progress 警报不会关闭(警告:尝试从视图控制器关闭...) - Alert won't dismiss (Warning: Attempt to dismiss from view controller…)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM