Creating an application that can open files of a given format

Posted by Brian Postow on Stack Overflow See other posts from Stack Overflow or by Brian Postow
Published on 2010-06-15T15:23:28Z Indexed on 2010/06/15 16:02 UTC
Read the original article Hit count: 281

Filed under:
|
|
|

I've got an app, written in Obj-C. The info.plist has a list of file types that the app can open. I'm pretty sure that this is working because when I try to drag a file of an unacceptable type, the app doesn't highlight, but when I drag a file of an acceptable type, it does highlight, and lets me drop.

When I drop, the app starts up, correctly, however, then I get a dialog saying:

The document "foo.tiff" could not be opened. DocView cannot open files in the "TIFF File" format.

I DO have this in my 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>

Thanks.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about mac