我試圖關聯我的應用程序創建的自定義文件(它是XML),以便用戶可以通過電子郵件將文件發送給對方。我在這裏遵循的優秀教程:在iOS中關聯我的應用程序的自定義文件
How do I associate file types with an iPhone application?
文件名爲XXX.checklist
但它不關聯。我相信我的問題是與public.mime類型的關鍵,因爲我不知道我應該放在那裏。以下是相關信息-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>
我已經實現了以上解決方案。但我很想在共享菜單上看到我的應用程序。你可以提供給我確切的答案 – 2015-06-22 08:15:08