• 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: Upgrading NSDocument format, best practice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Upgrading NSDocument format, best practice


  • Subject: Re: Upgrading NSDocument format, best practice
  • From: Markus Spoettl <email@hidden>
  • Date: Wed, 16 Sep 2009 16:28:50 +0200

On Sep 16, 2009, at 4:21 PM, I. Savant wrote:
In my opinion, you're on the right track. I think the simplest solution is to create a new file extension. Forget renaming the file - a different extension implies a different format. Doing this gives you all the mechanisms and warnings for free: marking the old format as "read only" (ie, the app isn't an editor of that format, only a viewer), then providing the new extension as an "editor role extension", when the user saves, I believe the dialog will automatically pop up the Save As dialogue with that format / extension (or the first editor-role extension) selected.

Wow ... let me decipher this paragraph, which I obviously didn't proofread. :-D


When defining your document types (in the Info.plist file), you can designate a type as having an "Editor" role. This is typical. Unchecking this makes it a type your application will only read, but not save. If you uncheck the editor role for your old type, then add a new type that has the editor role, a save action on a document of the old type should trigger the Save As dialog, with the new format (as an editor role) selected.

Better? ;-)


Better, yes, though I haven't had many problems understanding the first version either. You mustn't be too hard on yourself.

I didn't think of changing the file extension, that would definitely work. Thanks for that! I'm loosing my precious file extension which I'm so fond of, though.

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Upgrading NSDocument format, best practice
      • From: "I. Savant" <email@hidden>
References: 
 >Upgrading NSDocument format, best practice (From: Markus Spoettl <email@hidden>)
 >Re: Upgrading NSDocument format, best practice (From: "I. Savant" <email@hidden>)
 >Re: Upgrading NSDocument format, best practice (From: "I. Savant" <email@hidden>)

  • Prev by Date: Re: Upgrading NSDocument format, best practice
  • Next by Date: Re: Last Apple Help question (hopefully)
  • Previous by thread: Re: Upgrading NSDocument format, best practice
  • Next by thread: Re: Upgrading NSDocument format, best practice
  • Index(es):
    • Date
    • Thread