IOS:Warning: Attempt to dismiss from view controller <xxxxxxxxxController: 0x13f6840e0>
2014-11-25 11:44
851 查看
Ios:在你使用presentModalViewController加载过多的视图过程中,退出当前视图self dismissViewControllerAnimated:YES completion:nil];使用如果遇到报错,
2014-11-25 11:41:49.664
xxxx[4745:60b] Warning: Attempt to dismiss from view controller <xxxxxViewController: 0x13f6840e0> while a presentation or dismiss is in progress!
如果使用
if (![self.presentedViewController isBeingDismissed]) {
[self dismissViewControllerAnimated:YES completion:nil];
}
没有效果的情况下说明您的当前视图在主线程还没有加载出来,您可能需要使用如下代码
dispatch_after(dispatch_time(DISPATCH_TIME_NOW,
(int64_t)(0.51 *
NSEC_PER_SEC)),
dispatch_get_main_queue(), ^{
if (![self.presentedViewController
isBeingDismissed]) {
[self
dismissViewControllerAnimated:YES
completion:nil];
}
这样做的好处是让主线程等待0.5秒再退出视图, 就可以退出了!不信您试试!有效的请点赞!
2014-11-25 11:41:49.664
xxxx[4745:60b] Warning: Attempt to dismiss from view controller <xxxxxViewController: 0x13f6840e0> while a presentation or dismiss is in progress!
如果使用
if (![self.presentedViewController isBeingDismissed]) {
[self dismissViewControllerAnimated:YES completion:nil];
}
没有效果的情况下说明您的当前视图在主线程还没有加载出来,您可能需要使用如下代码
dispatch_after(dispatch_time(DISPATCH_TIME_NOW,
(int64_t)(0.51 *
NSEC_PER_SEC)),
dispatch_get_main_queue(), ^{
if (![self.presentedViewController
isBeingDismissed]) {
[self
dismissViewControllerAnimated:YES
completion:nil];
}
这样做的好处是让主线程等待0.5秒再退出视图, 就可以退出了!不信您试试!有效的请点赞!
相关文章推荐
- IOS:Warning: Attempt to dismiss from view controller <xxxxxxxxxController: 0x15bd67f0> while a prese
- IOS:Warning: Attempt to dismiss from view controller <xxxxxxxxxController: 0x15bd67f0> while a prese
- Warning: Attempt to dismiss from view controller <LoginViewController: 0xbb9c0f0> while a presentat
- iOS开发之bug:ios Warning: Attempt to present <a viewController: 0x10d0611b0> on <UITabBarController: 0
- iOS: Warning: Attempt to present <ModalViewController> on <ViewController>while a presentation is in
- Warning: Attempt to present <NextViewController: 0x10966fed0> on
- iOS BUG: Unbalanced calls to begin/end appearance transitions for <XXXViewController: 0x7fcea3730650>.
- iOS - 报错 Warning: Attempt to present <xx: xx> on <xx: xx> whose view is not in the window hierarchy!
- iOS - 解决Warning: Attempt to present <UIImagePickerController: 0x7f9ba106a000>which is already presen
- 处理iOS报错: Warning “attempt to present ViewController whose view is not in the window hierarchy”
- Assigning to ‘id<UIWebViewDelegate>’ from incompatible type 'xxxViewController *const __strong'
- IOS Assigning to 'id<UITabBarControllerDelegate>' from incompatible type...
- pass all options of <select> from View to controller
- iOS - 解决Warning: Attempt to present <> which is already presenting <>
- Sending 'ViewController' to Parameter of Incompatible Type 'id<xxxDelegate>'
- iOS 跳转出现attempt to dismiss modal view controller whose view does not currently ……的解决方案
- Attempt to present <TestViewController2: 0x7fd7f8d10f30> on <ViewController: 0x7fd7f8c054c0> whose view is not in the window hierarchy!
- iOS常见问题之 IOS Assigning to 'id<XXXDelegate>' from incompatible type...
- Attempt to present <UINavigationController: 0x7fdf1b100e00> on <ViewController:0x....>
- failed to obtain a cell from its dataSource (<CooperateViewController: 0x7fe6fac7aa20>)'