Re: Opening a file
Re: Opening a file
- Subject: Re: Opening a file
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 23 Dec 2005 15:11:46 -0800
On Dec 23, 2005, at 2:04 PM, Eamon Ford wrote:
I have an application which isn't document-based, but which needs
to be able to open a certain file type. What would be the best way
to do this?
If you also need to allow users to drag files to the dock, add the
document type to the app's info.plist.
<
http://developer.apple.com/documentation/MacOSX/Conceptual/
BPRuntimeConfig/Articles/PListKeys.html>
For example:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>canasta</string>
</array>
<key>CFBundleTypeName</key>
<string>MyDocumentType</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
</dict>
</array>
You can most easily do this using the target's Properties Inspector
(under Document Types).
(See also <
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSApplication.html#//apple_ref/
occ/instm/NSObject/application:openFile:>.)
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden