我已经为这个问题找到了一些解决方案(它是由于仍然有一个活动的动画而引起的)。
但是,在iPad应用程序中使用UIDocumentInteractionController时,我无法解决我的应用程序中的该问题。
我的ViewController看起来像
MainViewController -> ContainerView
在这个ContainerView中,我有一个侧边栏,我想从这个侧边栏打开一个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 dissappear
Unbalanced calls to begin/end appearance transitions for <QLRemotePreviewContentController: 0x7d35d400>
viww Did dissapaer
有什么想法吗?提前感谢。