Ios 目标C:Popover被解除,而不向其他应用程序打开文件
在我正在使用的应用程序中,我需要从服务器下载文件,并将其本地存储在应用程序的沙箱中,然后使用Ios 目标C:Popover被解除,而不向其他应用程序打开文件,ios,objective-c,uipopovercontroller,uidocumentinteraction,Ios,Objective C,Uipopovercontroller,Uidocumentinteraction,在我正在使用的应用程序中,我需要从服务器下载文件,并将其本地存储在应用程序的沙箱中,然后使用UIDocumentInteractionController在iBooks中打开它 我已经完成了所有的下载、保存和向iBooks打开。但是,有时当我下载一个文件,然后将其打开到它没有实现的iBooks时,iBooks没有打开,但是数据门从开始显示到应用程序:到didEndSendingToApplication:到文档交互控制器iddismissinmenu:(我把日志放在上面检查)。然后,如果我重新启
UIDocumentInteractionController
在iBooks中打开它
我已经完成了所有的下载、保存和向iBooks打开。但是,有时当我下载一个文件,然后将其打开到它没有实现的iBooks时,iBooks没有打开,但是数据门从开始显示到应用程序:
到didEndSendingToApplication:
到文档交互控制器iddismissinmenu:
(我把日志放在上面检查)。然后,如果我重新启动应用程序,它会打开,然后不再打开,这是不一致的。有什么问题吗
下面是我向iBooks打开它的代码:
NSURL *url = [NSURL fileURLWithPath:filePath1];
DocController = [UIDocumentInteractionController interactionControllerWithURL:url];
DocController.delegate = self;
[DocController presentOpenInMenuFromRect:openIt.frame inView:menu animated:YES];
在.h中添加UIDocumentInteractionControllerDelegate后,可以添加以下函数:
- (UIViewController *) documentInteractionControllerViewControllerForPreview: (UIDocumentInteractionController *) controller
{
return self; //return the controller who open the doc
}