我有一个用 Obj-C 编写的应用程序。info.plist 包含应用程序可以打开的文件类型列表。我很确定这是可行的,因为当我尝试拖动不可接受类型的文件时,应用程序不会突出显示,但是当我拖动可接受类型的文件时,它会突出显示,并让我放下。
当我放下时,应用程序会正确启动,但是,然后我会看到一个对话框:
无法打开文档“foo.tiff”。DocView 无法打开“TIFF 文件”格式的文件。
我的 info.plist 中有这个
<key>CFBundleTypeExtensions</key>
<array>
<string>tif</string>
<string>tiff</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>TIFFFile.icns</string>
<key>CFBundleTypeName</key>
<string>TIFF File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TIFF</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Documents/</string>
谢谢。