• 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: Saving AttributedString with Attachments to RTFD
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving AttributedString with Attachments to RTFD


  • Subject: Re: Saving AttributedString with Attachments to RTFD
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Sun, 6 Apr 2008 19:59:50 +0200

RTFD is not a File, i'ts a bundle. Try to right clic on it in the Finder ;-)


Le 6 avr. 08 à 18:15, Reza Farhad a écrit :

Jean

Thanks for that, and it worked, but I am still surprised that I could not generate the file form the data. Is this a bug?

Fred


On 6 Apr 2008, at 16:54, Jean-Daniel Dupas wrote:


Le 6 avr. 08 à 17:39, email@hidden a écrit :
Dear All

I am trying to save an AttributedString with attachments to a RTFD file.

I am converting the Attributed string to NSData using:

NSData *textData = [ exportText RTFDFromRange:textRange documentAttributes:nil ];

and then saving it to fileName:

     [ textData writeToFile:fileName atomically:NO ];

The file that is generated appears to be the data structure of the RTFD file rather than a simple RTFD file that can be opened by textEdit.

Can anybody suggest what else I need to do or what I am doing wrong.

Thanks

Fred

PS. I can get what I want by creating a NSTextView form the attributedString and then saving it to file using the NSText method:

	[ textView writeRTFDToFile:fileName atomically:NO ];

but I feel this should not be necessary.

Did you try with -[NSAttributedString RTFDFileWrapperFromRange:documentAttributes:] ?
and the -[NSFileWrapper writeToFile:atomically:updateFilenames:]





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Saving AttributedString with Attachments to RTFD (From: email@hidden)
 >Re: Saving AttributedString with Attachments to RTFD (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Saving AttributedString with Attachments to RTFD (From: Reza Farhad <email@hidden>)

  • Prev by Date: Re: how to hack my own apps
  • Next by Date: Re: Delegate not getting called for CATiledLayer
  • Previous by thread: Re: Saving AttributedString with Attachments to RTFD
  • Next by thread: Re: Saving AttributedString with Attachments to RTFD
  • Index(es):
    • Date
    • Thread