File types opened by NSDocument architecture
File types opened by NSDocument architecture
- Subject: File types opened by NSDocument architecture
- From: Tom Bernard <email@hidden>
- Date: Tue, 22 Jul 2008 01:11:59 -0600
- Thread-topic: File types opened by NSDocument architecture
/*
+ (NSArray *)readableTypes
{
return [NSArray arrayWithObjects:@"TIFF", @"tiff", @"TIF", @"tif",
@"GIF", @"gif", @"JPEG", @"jpeg", @"JPG", @"jpg", @"png", nil];
}
*/
My application needs to open the above listed file types. When I am in
Finder and I drag and drop one one of these files to my application, the
file opens. When I choose 'Open...' from my application's 'File' menu, only
.tif and .psd files are selectable in the open dialog.
Note that +readableTypes is commented out above. When I uncomment the method
in my NSDocument implementation, no files are selectable in the open dialog.
Here is an excerpt from my info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>psd</string>
</array>
<key>CFBundleTypeName</key>
<string>Adobe Photoshop file</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>psd</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>LIVDocument</string>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>gif</string>
</array>
<key>CFBundleTypeIconFile</key>
<string></string>
<key>CFBundleTypeName</key>
<string>Large Image Viewer GIF Document</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>gif</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>LIVDocument</string>
</dict>
...
</array>
The info.plist includes a dictionary for each of the above listed types.
Thanks in advance.
Tom Bernard
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden