Re: NSTextView and SimpleText files?
Re: NSTextView and SimpleText files?
- Subject: Re: NSTextView and SimpleText files?
- From: Douglas Davidson <email@hidden>
- Date: Tue, 3 Jun 2003 09:50:51 -0700
On Monday, June 2, 2003, at 8:16 PM, M. Uli Kusterer wrote:
does anyone have code that loads a SimpleText file (raw text in the
data fork, style information in a 'styl' resource in the resource
fork) into an NSTextView? Or even better, do NSTextView or NSText have
methods to do that?
The text system does that for you--try opening a SimpleText file in
TextEdit. 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.
Douglas Davidson
_______________________________________________
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.