Re: Best Practices for Associating a File Extension With a File in XCode 4?
Re: Best Practices for Associating a File Extension With a File in XCode 4?
- Subject: Re: Best Practices for Associating a File Extension With a File in XCode 4?
- From: Quincey Morris <email@hidden>
- Date: Sun, 04 Sep 2011 01:33:51 -0700
On Sep 4, 2011, at 01:07 , Vik Rubenfeld wrote:
> So I still haven't discovered how to tell NSSavePanel what file extension my document should be, when calling saveDocumentWithDelegate:didSaveSelector:contextInfo.
See:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Documents/Concepts/DocTypePList.html#//apple_ref/doc/uid/20000024-BHADAGHF
NSDocument abstracts the document "type" away from the file "type", because the file type can be variously represented by extensions, UTIs, MIME types, and other legacy things. The mappings between the various ways of representing types is kept in the plist as described in the above document.
The Save panel uses this same information to determine defaults for documents being saved.
In the very simplest case, the plist will contain a single document type declaration with an associated file extension. In that scenario, the Save panel will return a filename with that extension.
_______________________________________________
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