我的应用程序处理的文件类型*.mndl
不超过自定义的*.plist
. 到目前为止,我一直在使用*.plist
文件,但现在我想关联扩展名并能够*.mndl
从任何其他应用程序打开文件,我意识到重命名file.plist
为file.mndl
不起作用。(因此,我什至不知道我是否正确地进行了扩展关联和导出操作)
我从计算机向自己发送了一个文件file.mndl
,当在 mail.app 中收到时,我得到了
file.mndl.plist
(它被自动重命名,这发生在重置我的 iPad 时)
如何创建自己的 mndl 文件,同时能够使用+dictionaryWithContentsOfFile:
NSDictionary 类读取其内容?
即使我正在使用 iOS,我也相信这种东西是从 MacOS 和 Cocoa 移植过来的。所以 Cocoa 开发人员也可以知道这一点。
感谢您的评论/回答。
谢谢
回答:仅出于完成目的这是我在 info.plist 中添加的内容:
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Mandala Chart File</string>
<key>UTTypeIdentifier</key>
<string>com.nacho4d.Accordion.mndl</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>mndl</string>
</dict>
</dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Document320Icon.png</string>
<string>Document64Icon.png</string>
</array>
<key>CFBundleTypeName</key>
<string>Mandala Chart File</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.nacho4d.Accordion.mndl</string>
</array>
</dict>
</array>