Re: Reading and writing rtf(d) files
Re: Reading and writing rtf(d) files
- Subject: Re: Reading and writing rtf(d) files
- From: Ali Ozer <email@hidden>
- Date: Thu, 2 Jul 2009 16:55:40 -0700
TextEdit sources in /Developer/Examples/AppKit/TextEdit may be
useful. TextEdit's document types are set up to read/write RTF and
RTFD, in addition to a number of other types.
Ali
On Jul 2, 2009, at 14:04 , Ian Piper wrote:
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
_______________________________________________
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