私のアプリケーションが作成するカスタムファイル(XML)を関連付けると、ユーザーはファイルを互いにメールで送ることができます。私はここに優れたチュートリアルに従っている:私のアプリケーションのカスタムファイルをiOSに関連付ける
How do I associate file types with an iPhone application?
をファイルはXXX.checklist
命名された。しかし、それは関連付けていません。私は私の問題がpublic.mime-typeのキーであると信じています。私はそこに置くはずのものが何もわからないからです。以下は、私はあなたのチェックリストファイルは、カスタムバイナリデータであることを前提としていpublic.data
としてあなたUTIが宣言されている場合は関連する情報-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>
私は上記の解決策を実装しています。私は共有メニューで私のアプリを見ることができます。私はそれに対して正確な答えを提供することができます –