我使用 UIDocumentInteractionController 在 iPad (4.3.3) 上快速查看。
NSURL *url = [NSURL fileURLWithPath:path];
self.doc = [UIDocumentInteractionController interactionControllerWithURL:url];
self.doc.delegate = self;
[self.doc presentPreviewAnimated:YES];
这适用于所有支持的类型和最大 (~ 2000x2000 像素) 的 jpg 图像。然后我尝试快速查看 6000x6000 像素的 jpg 图像,并收到消息崩溃:
[Switching to process 11779 thread 0x0]
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J3)/Symbols/System/Library/Frameworks/QuickLook.framework/DisplayBundles/Image.qldisplay/Image (file not found).
warning: No copy of Image.qldisplay/Image found locally, reading from memory on remote device. This may slow down the debug session.
模拟器上的大图像工作正常。Quicklook.framework 处于构建阶段。什么原因?大图像大小 = 426Kb(压缩 jpeg)。
UPD:iPad2 上的相同故事
UPD2:我尝试改用 UIWebView,没有崩溃但没有理想的解决方案