ios在DocumentsDirectory的ibooks中打开pdf

时间:2012-04-02 16:13:23

标签: ios pdf uidocumentinteraction uti

我正在尝试使用此代码打开我生成并保存在我的文档目录中的pdf以及其他应用程序(如ibook):

NSLog(@"Send PDF: %@", _pdfPath);
NSURL *url = [NSURL fileURLWithPath:_pdfPath];
docController = [UIDocumentInteractionController interactionControllerWithURL:url];
docController.UTI=@"com.adobe.pdf";   
BOOL isValid = [docController presentOpenInMenuFromBarButtonItem:sender animated:YES];

似乎它必须工作正常但是当弹出式弹出式ibooks不存在时,我有其他应用程序但不是ibooks。我知道PDF格式正确,因为我可以在预览中打开它。谁知道我做错了什么?我看过很多教程但没找到解决方案

1 个答案:

答案 0 :(得分:1)

您不需要UTI,如果您安装了iBooks,它应该出现在弹出菜单中,您确定已经安装了iBooks吗?