Ios 如何使用“打印”按钮打印已在QLPreviewController中打开的PDF文件?

Ios 如何使用“打印”按钮打印已在QLPreviewController中打开的PDF文件?,ios,objective-c,ios6.1,uidocumentinteraction,qlpreviewcontroller,Ios,Objective C,Ios6.1,Uidocumentinteraction,Qlpreviewcontroller,我得到二进制数组,然后将其转换并保存在Documents文件夹中,然后显示在QLViewController中。我已经看到了QLPreviewController工具栏上的右按钮 我想现在打印预览中的内容。但当我发现错误时 *** Assertion failure in -[UIDocumentInteractionController setURL:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIDocumentInteractionController.

我得到二进制数组,然后将其转换并保存在Documents文件夹中,然后显示在QLViewController中。我已经看到了QLPreviewController工具栏上的右按钮

我想现在打印预览中的内容。但当我发现错误时

*** Assertion failure in -[UIDocumentInteractionController setURL:], /SourceCache/UIKit_Sim/UIKit-2380.17/UIDocumentInteractionController.m:960

另外,请指导我如何打印该文档。我已经阅读了UIPrintInteractionController。

为什么会因为URL设置错误而发生此错误。 您正在这样设置url

/Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf
其中作为UIDocumentationController任务URL作为:

file://localhost/Users/akrama2/Library/Application%20Support/iPhone%20Simulator/6.1/Applications/59356D13-C021-431F-A5D2-B8CD16E2B301/Documents/Application_Report.pdf
这个小错误会让你发疯的;)