本文介绍了QLPreviewController:快速加载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些使用QLPreviewController显示简单PDF的简单代码.它在模拟器和非常简单的应用程序中都很好用.

I've got some simple code showing a simple PDF, using QLPreviewController. It works great in the simulator, and in a very simple app.

在我实际上希望其运行的应用程序中,该设备在设备上失败.该设备显示预览视图,但是代替PDF,它仅显示文本"simple.pdf,可移植文档格式(PDF)"和文件大小(在这种情况下为"301KB").

In the app I actually want it to work in, it fails on the device. The device shows the preview view, but in place of the PDF it simply shows the text "simple.pdf, Portable Document Format (PDF)" and the size of the file ("301KB" in this case).

有趣的是,日志发出无法快速加载错误消息:操作无法完成.(可可错误4097.)"

Interestingly, the log emits "Failed to load quicklookd with error : The operation couldn’t be completed. (Cocoa error 4097.)"

我尝试过:

  • 几个PDF,一个简单的全文,以及IRS的W4 PDF.结果相同.
  • 改为使用UIDocumentInteractionController.结果相同.

排除:

  • 在构建阶段中,我正在与QuickLook.framework链接.
  • [QLPreviewController canPreviewItem:]返回是.

我的观点层次结构并不十分复杂;在 SWRevealViewController 前面的UINavigationController.当PDF是Quicklook时,导航层次结构中的浅浅或深浅都没关系.

My view heirarchy is not terribly complex; a UINavigationController fronting a SWRevealViewController. Doesn't matter how shallow or deep I am in the navigation hierarchy when the PDF is Quicklook'd.

我没有主意,希望有人能识别出错误.

I'm out of ideas and am hoping someone recognizes the error.

该应用在iOS 6设备上可以正常运行.在6.1、7.0和7.1的模拟器中均可使用.在7.0设备上失败,哎呀!

edit: app works fine on an iOS 6 device. Works in the simulator on 6.1, 7.0, and 7.1. Fails on a 7.0 device, argh!

推荐答案

这是64位设备上的问题.您可以在64位iOS 7模拟器中复制它.此处报告了与其他框架相同的错误:

This is an issue on 64bit devices. You can replicate it in the 64 bit iOS 7 simulators. The same error with other frameworks is reported here :

无法在iOS7中显示模式ViewController

将构建设置中的体系结构设置更新为标准体系结构(包括64位)(armv7,armv7s,arm64)"(也称为$(ARCHS_STANDARD_INCLUDING_64_BIT))将解决此问题.当然,如果您拥有所有第三方库的兼容版本.

Updating the architectures setting in build settings to 'Standard architectures (including 64-bit) (armv7, armv7s, arm64)' aka $(ARCHS_STANDARD_INCLUDING_64_BIT) will fix the issue. That is of course if you have compatible versions of all your 3rd party libraries.

由于只有Apple工程师才知道的原因,删除不同的外观委托更改至少还可以通过iOS 7.0.4提供解决方法.就我而言,引起问题的外观变化是

For reasons only apple engineers could know, removing different appearance delegate changes also provides a workaround up through iOS 7.0.4 at least. In my case the appearance change that brought about the issue is

[[UITableView外观] setSeparatorInset:UIEdgeInsetsZero];

[[UITableView appearance] setSeparatorInset:UIEdgeInsetsZero];

这篇关于QLPreviewController:快速加载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-20 23:38