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: Vik Rubenfeld <email@hidden>
- Date: Sun, 04 Sep 2011 09:06:58 -0700
That clears up a lot! I believe I now know that I do not need to find a method that assigns a file extension; instead, I just need to fill out the XCode application properties correctly.
Part of my difficulty has been that the docs to which you have provided a link are for, I believe, XCode 3, and do not fully describe XCode 4. I have set up my XCode 4 app properties as shown in this screen shot:
http://tinyurl.com/3gu72xp
I created a document type XML; assigned it to my document class; and filled in a file extension for it.
I cleaned my XCode project, recompiled and ran. Still no file extension is appended to the document when I save it. Are there or more final steps I am leaving out?
On Sep 4, 2011, at 1:33 AM, Quincey Morris wrote:
> 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