• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Opening a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening a file


  • Subject: Re: Opening a file
  • From: Eamon Ford <email@hidden>
  • Date: Fri, 23 Dec 2005 15:32:19 -0800

Okay, thanks!


On Dec 23, 2005, at 3:11 PM, mmalcolm crawford wrote:


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

_______________________________________________
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
References: 
 >Opening a file (From: Eamon Ford <email@hidden>)
 >Re: Opening a file (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Opening a file
  • Next by Date: Re: Keyboard focus indicator line style
  • Previous by thread: Re: Opening a file
  • Next by thread: Crash in objc_msgSend_rtp when calling add action of NSArrayController
  • Index(es):
    • Date
    • Thread