0

我正在尝试使用 DocumentInteractionController 将带有我的扩展名的自定义文件保存到 Dropbox。当我的文件具有可识别的扩展名(例如 .txt)时,Dropbox 确实会显示在 DocumentInteractionController 的“打开方式”菜单中。我试图关注许多相关的主题。一个例子:在 iOS 中关联我的应用程序的自定义文件

下面显示了我的 UIExportedTypeDeclarations:

<key>UIExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UITypeIdentifier</key>
        <string>com.mysite.myapp.myext</string>
        <key>UITypeDescription</key>
        <string>My Special File</string>
        <key>UITypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <string>myext</string>
            <key>public.mime-type</key>
            <string>application/octet-stream</string>
        </dict>
        <key>UITypeConformsTo</key>
        <array>
            <string>public.data</string>
            <string>public.content</string>
        </array>
    </dict>
</array>

我什至不确定 Dropbox 是否查看 ConformsTo 甚至 TagSpecification。当我测试一个 .txt 文件时,它确实出现在 Open In 菜单中,并且无意中为 public.filename-extension 键留下了“myextension”。所以,也许我对 UIExportedTypeDeclarations 的想法,或者我对 Dropbox 文件处理的期望,是不合时宜的。任何帮助将不胜感激。我在转动我的轮子。谢谢。

4

1 回答 1

0

拼写错误:UIExportedTypeDeclaration 不是 UTExportedTypeDeclaration。大脑中的 UIKit 有点太多了。修复拼写解决了问题。当然,所有标签都需要修复。

于 2013-04-28T12:30:50.823 回答