如何将excel文件类型(xlsx)与iPhone应用程序相关联 [英] How do i associate excel file type (xlsx) with iPhone application

查看:597
本文介绍了如何将excel文件类型(xlsx)与iPhone应用程序相关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我通过向项目构建添加文档类型并将Types字段设置为com.microsoft.excel.xls(参见屏幕截图),设法通过邮件应用程序打开.xls文件。

我想对xlsx文件做同样的事但不能这样做。我试图添加com.microsoft.excel.xlsx,但它不起作用

Hi
i have managed to open .xls files form mail app by adding document type to the project build and set the Types field to "com.microsoft.excel.xls" (see screen shot).
I want to do the same with xlsx files but can't do it. I tried to add "com.microsoft.excel.xlsx" but it didn't work

推荐答案

我通过定义自定义UTI解决了这个问题,如下所示。尝试将这些定义添加到info.plist中。它按预期工作。

I solved that by defining custom UTI as follows. Try to add these definitions into your info.plist. It works as expected.

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeDescription</key>
        <string>XLSX input table document</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <string>xlsx</string>
            <key>public.mime-type</key>
            <string>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</string>
        </dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.data</string>
        </array>
        <key>UTTypeIdentifier</key>
        <string>com.mydomain.myapplication.xlsx</string>
    </dict>
</array>

....

<key>CFBundleDocumentTypes</key>
<array>

    <dict>
        <key>CFBundleTypeName</key>
        <string>XLSX input table document</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.mydomain.myapplication.xlsx</string>
        </array>
    </dict>
</array>

这篇关于如何将excel文件类型(xlsx)与iPhone应用程序相关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆