UIViewController presentViewController在ios 8上崩溃 [英] UIViewController presentViewController crashing on ios 8

查看:517
本文介绍了UIViewController presentViewController在ios 8上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚在我们的错误记录系统中出现此错误,一直在搜索高低,似乎无法找到任何解决方案。任何帮助表示赞赏。这是堆栈跟踪

Just got this error in our error logging system, been searching hi and low and can't seem to find any solution. Any help is appreciated. Here is the stacktrace.

推荐答案

可能在您的XCODE日志中可能遇到此消息

May be in your XCODE log you might have encountered this message


在分离视图上呈现视图控制器控制器是
气馁。

"Presenting view controllers on detached view controllers is discouraged ".

如果是,则尝试

[self.view.window.rootViewController presentViewController:myVC];

如果失败那么请确保你调用presentViewController:myVC立即呈现ViewController,即在你的情况下我从trace中看到 - CalendarEventDetailViewController。

if this fails then make sure you call presentViewController:myVC on immediate presenting ViewController i.e. in your case what I see from trace - CalendarEventDetailViewController.

如果那也失败那么后退 - 从你调用VC的地方开始使用presentViewController,在iOS8表示层中特别改变了WRT UIAlert / UIActionSheet和U​​IPopovers,
如果您正在使用其中任何一个,请将UIAlertController创建为iOS8的单独代码轨道,并在呈现ViewController时使用presentViewController:myVC。

If that too fail then go backward - from where you are invoking VC which in turn use presentViewController, in iOS8 presentation layer has changed specially WRT UIAlert/UIActionSheet, and UIPopovers, if you are using any of these, create UIAlertController as a separate code track for iOS8 and use presentViewController:myVC on presenting ViewController.

我遇到了类似的问题其中presentViewController:根本不工作或破坏呈现VC内容,在某些情况下dismissViewController崩溃。使用这种方法我可以解决它。

I was facing similar issue where presentViewController: not working at all or disrupting presenting VC contents, in some situations dismissViewController was crashing. Using this approach I could fix it.

这篇关于UIViewController presentViewController在ios 8上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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