• 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 with RTF as string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView with RTF as string?


  • Subject: Re: NSTextView with RTF as string?
  • From: John Timmer <email@hidden>
  • Date: Fri, 06 May 2005 14:35:01 -0400

Title: Re: NSTextView with RTF as string?
My intention for this is to build a table with a number of rows that I can determine programmatically using RTF.  There doesn’t seem to be a way to control tables in a text view programmatically, so I figured i’d have to manipulate the contents more directly – I decided to just work with the contents of a template file.  I found that if you delete the “\lastrow” tag, you can insert another row beneath it and close that with \lastrow.  

The reason I asked the question that I did was that I apparently had the process working, as evidenced by dumping the string to the file.  I just can’t seem to get them back into a text view for user view/editing afterwards.  I guess I could figure out the ranges for the appropriate data and manipulate the RTF as data, see if table attributes are maintained when attributed strings are formed out of RTF and work with that formatting, or just give up and go with HTML.

JT


You should make the NSData of the RTF text using RTFFromRange:documentAttributes: rather from the UTF8 string. The two codings are completely different.

That said, why not just use use replaceCharactersInRange:withAttributedString: on the NSTextStorage of the view?


_______________________________________________
This mind intentionally left blank
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTextView with RTF as string?
      • From: Douglas Davidson <email@hidden>
    • Re: NSTextView with RTF as string?
      • From: Ondra Cada <email@hidden>
References: 
 >NSTextView with RTF as string? (From: John Timmer <email@hidden>)

  • Prev by Date: Re: Function to write to one pixel
  • Next by Date: Interface builder question
  • Previous by thread: Re: NSTextView with RTF as string?
  • Next by thread: Re: NSTextView with RTF as string?
  • Index(es):
    • Date
    • Thread