如何将excel文件类型(xlsx)与iPhone应用程序相关联

问题描述 投票:10回答:3

你好 我已经设法通过向项目构建添加文档类型来打开.xls文件形式的邮件应用程序,并将Types字段设置为“com.microsoft.excel.xls”(参见屏幕截图)。 我想对xlsx文件做同样的事但不能这样做。我试图添加“com.microsoft.excel.xlsx”但它没有用

xcode4 ios5 uti
3个回答
15
投票

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

<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>

0
投票

XLSX已声明为org.openxmlformats.presentationml.presentation


0
投票

XLSX文件的标识符是org.openxmlformats.spreadsheetml.sheet

© www.soinside.com 2019 - 2024. All rights reserved.