Re: NSTextView and SimpleText files?
Re: NSTextView and SimpleText files?
- Subject: Re: NSTextView and SimpleText files?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Thu, 5 Jun 2003 01:56:47 +0200
At 9:50 Uhr -0700 03.06.2003, Douglas Davidson wrote:
The text system does that for you--try opening a SimpleText file in TextEdit.
Douglas,
Yeah, that it worked in TextEdit made me guess that there already is
some code, but I wasn't sure whether that was TextEdit's doing, or
Cocoa's.
The relevant methods for most text loading are defined in the
AppKit on NSAttributedString and NSMutableAttributedString, in the
AppKit's NSAttributedString.h header. The most general is the
NSMutableAttributedString method
readFromURL:options:documentAttributes:, but there are a number of
others. The list of supported formats (which may grow) is given
near the top of the file, as the list of values for the
@"DocumentType" key.
Oh really? Cool. I have to admit, I rolled my own in the meantime
(it's not really a very complicated format). If anyone's interested
in the source code, just holler. It may be useful for other cases
where you have to import from foreign styles and such stuff.
But just to be safe, I'm going to switch to Cocoa's code. After all,
their code has undergone a lot more debugging than mine has :-)
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.