ios – 警告:不平衡的调用开始结束QLRemotePreviewContentController的显示转换

ios – 警告:不平衡的调用开始结束QLRemotePreviewContentController的显示转换,第1张

概述我已经找到了一些这个问题的解决方案(这是因为还有一个活动的动画). 但是当我在iPad应用程序中使用UIDocumentInteractionController时,我无法解决这个问题. 我的ViewController看起来像 MainViewController – > ContainerView 在这个ContainerView我有一个Sidebar,从这个SideBar我想打开一个UIDo 我已经找到了一些这个问题的解决方案(这是因为还有一个活动的动画).

但是当我在iPad应用程序中使用UIdocumentInteractionController时,我无法解决这个问题.

我的VIEwController看起来像

MainVIEwController
– > ContainerVIEw

在这个ContainerVIEw我有一个SIDebar,从这个SIDebar我想打开一个UIdocumentInteractionController.

我使用NSNotification,因为这个“MainVIEwController”应该处理来自不同视图的多个文件.

所以:(这是在我的MainVIEwController)

func openfile(notification: NSNotification){    fileUrl = notification.object as NSURL    var documentInteractionController = UIdocumentInteractionController(URL: self.fileUrl!)    documentInteractionController.delegate = self    documentInteractionController.presentPrevIEwAnimated(false)}func documentInteractionControllerVIEwControllerForPrevIEw(controller: UIdocumentInteractionController) -> UIVIEwController {    return self}

但生病总会得到以下错误:

警告:QLRemotePrevIEwContentController的不平衡调用开始/结束外观转换

我不知道为什么应该没有动画,如果我打开另一个(模态)窗口,这里没有警告.

如果我使用延迟(例如5秒!),则会出现此警告.

编辑:发现我可能是我的ContainerVIEw的问题.当我包含“VIEwWilldissapear”和“VIEwDIDdisappear”不正确的错误在这里:

vIEw will dissappearUnbalanced calls to begin/end appearance Transitions for <QLRemotePrevIEwContentController: 0x7d35d400>viww DID dissapaer

有任何想法吗?提前致谢

解决方法 您的应用程序必须使用导航控制器.如果是这样,导航控制器必须是处理预览的交互的导航控制器,而不是其中的视图控制器.

使用self.navigationController替换documentInteractionControllerVIEwControllerForPrevIEw中的返回自身应该可以解决问题.但是,您需要安全地打开navigationController.请参阅下面的完整方法:

func documentInteractionControllerVIEwControllerForPrevIEw(controller: UIdocumentInteractionController) -> UIVIEwController {    if let navigationController = self.navigationController {        return navigationController    } else {        return self    }}

Cudos to @staxim为Objective-C解决方案!

总结

以上是内存溢出为你收集整理的ios – 警告:不平衡的调用开始/结束QLRemotePreviewContentController的显示转换全部内容,希望文章能够帮你解决ios – 警告:不平衡的调用开始/结束QLRemotePreviewContentController的显示转换所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1110975.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存