- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我已经找到了这个问题的一些解决方案(这是因为仍然有一个事件的动画引起的)。
但是当我在 iPad 应用程序上使用 UIDocumentInteractionController 时,我无法在我的应用程序中解决这个问题。
我的 ViewController 看起来像
主视图 Controller -> 容器 View
在这个 ContainerView 中我有一个边栏,我想从这个边栏打开一个 UIDocumentInteractionController。
我使用 NSNotification,因为这个“MainViewController”应该处理来自不同 View 的多个文件。
所以:(这是在我的 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
有什么想法吗?提前致谢
最佳答案
您的应用程序必须使用导航 Controller 。如果是这种情况,导航 Controller 必须是处理预览交互的 Controller ,而不是其中的 View Controller 。
将 documentInteractionControllerViewControllerForPreview
中的 return self
替换为 self.navigationController
应该可以解决问题。但是,您需要安全地解包 navigationController
。请参阅下面的完整方法:
func documentInteractionControllerViewControllerForPreview(controller: UIDocumentInteractionController) -> UIViewController {
if let navigationController = self.navigationController {
return navigationController
} else {
return self
}
}
感谢 @staxim 的 Objective-C 解决方案!
关于ios - 警告 : Unbalanced calls to begin/end appearance transitions for QLRemotePreviewContentController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26309793/
我正在使用 Objective-C。我想快速打开一个本地文件。我的 mainViewController 中有这段代码: - (IBAction)open:(id)sender { QLPre
我已经找到了这个问题的一些解决方案(这是因为仍然有一个事件的动画引起的)。 但是当我在 iPad 应用程序上使用 UIDocumentInteractionController 时,我无法在我的应用程
我是一名优秀的程序员,十分优秀!