Hi all,

I have a question about reading and writing file types. I have been following an old Apple text editor example (http://developer.apple.com/documentation/Cocoa/Conceptual/TextArchitecture/Tasks/TextEditor.html ), and want to extend it to allow me to read and write rtf files. At least, I want it to be able to round-trip rich text files with TextEdit. From the example:

"At this stage of its development, your editor opens and saves documents only with an extension of ????. To enable your application to save and open documents with a recognized file type, you need to use Xcode to configure the application’s document types settings as described in “Storing Document Types Information in the Application's Property List” in Document-Based Applications Overview. For complete details about application property lists, see Runtime Configuration Guidelines."

I read the documents, and an example from 2001 by Mike Beam () and also looked at the settings for the TextEdit example. I ended up setting it like so:

Creator: ttxt

Name: DocumentType
Extensions: rtfd
MIME Types: text/rtfd
OS Types: rtfd

My program writes files with rich content and reads them OK. But it won't read rtfd files that I have created elsewhere (I can select such files but they just don't open - nothing happens). Also, TextEdit will read files that I have created using my editor, but they are in plain text with lots of tutti-frutti.

Can anyone point me to an example that describes how I am supposed to tell my application that it should read and write rtf (or rtfd) files?

Ian.
--
ianpi...@mac.com
07590 685840 | 01926 811383




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to