Reading and writing rtf(d) files
Reading and writing rtf(d) files
- Subject: Reading and writing rtf(d) files
- From: Ian Piper <email@hidden>
- Date: Thu, 2 Jul 2009 22:04:25 +0100
bump bump :-)
Ian.
--
email@hidden
07590 685840 | 01926 811383
Begin forwarded message:
From: Ian Piper <email@hidden>
Date: 1 July 2009 3:53:52 pmBST
To: email@hidden
Subject: Reading and writing rtf(d) files
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.
--
email@hidden
07590 685840 | 01926 811383
_______________________________________________
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