• 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: Douglas Davidson <email@hidden>
  • Date: Fri, 6 May 2005 12:57:50 -0700


On May 6, 2005, at 11:35 AM, John Timmer wrote:

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.

First, there certainly are means of manipulating tables in a text view programmatically.  There is some documentation in the works on this, but the ingredients are all there in the AppKit Tiger release notes--see the discussion of NSTextBlock et al.  

Second, if you do want to work with template files, I would suggest using HTML.  HTML is designed so that its source is an editable string; RTF is not.  

Personally, if I were manipulating an existing table, I would choose to do so in code.  If I wanted to store a canned representation of a predefined table for later insertion, with perhaps small modifications, I would probably choose to use an HTML template.

Douglas Davidson

 _______________________________________________
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: John Timmer <email@hidden>
References: 
 >Re: NSTextView with RTF as string? (From: John Timmer <email@hidden>)

  • Prev by Date: Re: NSTextView with RTF as string?
  • Next by Date: Re: CoreData issue when updating a file format
  • Previous by thread: Re: NSTextView with RTF as string?
  • Next by thread: Re: NSTextView with RTF as string?
  • Index(es):
    • Date
    • Thread