zoukankan      html  css  js  c++  java
  • iOS 里面如何使用第三方应用程序打开自己的文件,调用wps其他应用打开当前应用里面的的ppt doc xls

     我们的自己的应用里面经常涉及的要打开ppt doc,这样的功能,以前总以为iOS沙盒封闭化,不可能实现,后来终于解决了

    使用

    UIDocumentInteractionController 来解决这一问题

    使用下面代码,就可以打开airdrop ,然后你选择wps , 打开文档,OK 

    - (IBAction)download:(id)sender {

       

        NSString* path = [[NSBundlemainBundle] pathForResource:@"aa"ofType:@"docx"];

        NSURL *file_URL = [NSURL fileURLWithPath:path];

        

        NSFileManager* fileManager = [NSFileManagerdefaultManager];

        if ([fileManager fileExistsAtPath:path]) {

            if (self.fileInteractionController == nil) {

                fileInteractionController = [[UIDocumentInteractionControlleralloc] init];

                

                fileInteractionController = [UIDocumentInteractionControllerinteractionControllerWithURL:file_URL];

                fileInteractionController.delegate = self;

                //[fileInteractionController retain];

                

            }else {

                self.fileInteractionController.URL = file_URL;

            }

            

            [self.fileInteractionControllerpresentPreviewAnimated:YES];

            

        }

        

    }

  • 相关阅读:
    2019.5.1
    拓扑排序(topological sort)
    邻接表+链式前向星
    桶排序+基数排序+计数排序
    奶牛排队
    set
    win10家庭版怎么开启Administrator超级管理员帐户
    Office Online Server 在线编辑Office文档,安装部署
    Centos分区/超过2T的磁盘
    win10照片查看器不能看jpg等格式图片
  • 原文地址:https://www.cnblogs.com/ccguo/p/3461134.html
Copyright © 2011-2022 走看看