【发布时间】:2012-02-24 16:40:30
【问题描述】:
我正在尝试关联我的应用程序创建的自定义文件(它是 XML),以便用户可以通过电子邮件将文件发送给彼此。我在这里遵循了优秀的教程:
How do I associate file types with an iPhone application?
文件名为 XXX.checklist
但它没有关联。我相信我的问题在于 public.mime-type 键,因为我不知道我应该放什么。以下是相关的 info-plist 条目
<key>CFBundleDocumentTypes</key>
<array>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>docIcon64.png</string>
<string>docIcon320.png</string>
</array>
<key>CFBundleTypeName</key>
<string>My App Checklist</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.mycompany.appid.checklist</string>
</array>
</dict>
</array>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.content</string>/// i tried public.text but it allowed the file to be opened by the devices default text viewer which I would not like.
</array>
<key>UTTypeDescription</key>
<string>My App Checklist</string>
<key>UTTypeIdentifier</key>
<string>com.mycompany.appid.checklist</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key> // fixed this key
<string>checklist</string>
<key>public.mime-type</key>
<string>text/xml</string> /// changed to this, still doest work though
</dict>
</dict>
</array>
【问题讨论】:
-
我已经实现了上述解决方案。但我可以在共享菜单上看到我的应用程序。你能给我确切的答案吗
标签: ios file registration