【问题标题】:How do i associate excel file type (xlsx) with iPhone application如何将 excel 文件类型 (xlsx) 与 iPhone 应用程序相关联
【发布时间】:2012-03-18 02:14:27
【问题描述】:


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

【问题讨论】:

  • 我被这个问题困住了!!!

标签: xcode4 ios5 uti


【解决方案1】:

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

结帐:https://escapetech.eu/manuals/qdrop/uti.html

【讨论】:

  • 我不知道为什么没有人投票支持你的答案,但这对我有用。谢谢!
【解决方案2】:

XSLX 已经声明为org.openxmlformats.presentationml.presentation

【讨论】:

  • 这是 PPTX,不是 XLSX。
  • 即使你这样做,它也不起作用,除非你像大卫的回答那样添加自定义 UTI。
【解决方案3】:

我通过如下定义自定义 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>

【讨论】:

    猜你喜欢
    • 2011-02-15
    • 2012-03-10
    • 2012-01-29
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 2014-05-03
    相关资源
    最近更新 更多