• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView and SimpleText files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSTextView and SimpleText files?
      • From: "M. Uli Kusterer" <email@hidden>
References: 
 >NSTextView and SimpleText files? (From: "M. Uli Kusterer" <email@hidden>)

  • Prev by Date: Re: Book: Mac OS X Advanced Development Techniques
  • Next by Date: Re: Window menu a la PB
  • Previous by thread: Re: NSTextView and SimpleText files?
  • Next by thread: Re: NSTextView and SimpleText files?
  • Index(es):
    • Date
    • Thread