How can I support reading one type and automatically converting (internally) to another?
Sometimes an application might understand how to read a type, but not how to write it, and when it reads documents of that type, it should automatically convert them to another type that you can write. An example of this would be an application that can read documents from an older version or from a competing product. It might want to read in the old documents and automatically convert them to the new native format. The first step is to add the old type as a read-only type (see “How can I support read-only types?”). By doing this, your application is able to open the old files, but they come up as untitled files. If you want to automatically convert them to be saved as your new type, you can override the readFrom… methods in your NSDocument subclass to call super and then reset the filename and type afterwards. You should use setFileType: and setFileURL: to set an appropriate type and name for the new document. When setting the filename make sure to strip the filename extension of th