Which way should my document class handle an older format?
Which way should my document class handle an older format?
- Subject: Which way should my document class handle an older format?
- From: Daryle Walker <email@hidden>
- Date: Sat, 04 Mar 2017 03:40:30 -0500
My document class reads in UTF-8 data for its internal format. The format has an older version that is ASCII-based. Since the latter is a subset of the former, my parser can handle both formats. Right now, I can’t write out in the older format. (The new format is just a text dump upon save. The old format would need to handle any post-ASCII values.)
I’m wondering how I should be the old format in the Info.plist. I could put it in as a second document type. This lets me set it as “Viewer” independently of the first format being set to “Editor.” Altering the message and trying to save gives a system error about the file not being able to be saved. However, the “isInViewMode” flag doesn’t get set, so the document is editable! (But the edits can’t be saved.)
The other way is to have one document type entry in the Info.plist, but put the old format as a second content type. Of course, it’ll always be in “Editor.” And the save sheet gets a pop-up menu for the format to be saved. I haven’t added an entry for exported-types in the p-list, so the menu is just the first type. The second type isn’t in the menu and if I try to duplicate the file (the new-world-order substitute for “Save As” since Lion), I get a can’t-be-saved error.
I guess the second scenario seems to be what I want, but it still seems ugly. Are there any better solutions?
—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com
_______________________________________________
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