• 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: Attributed string in user defaults, is RTFD data OK?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attributed string in user defaults, is RTFD data OK?


  • Subject: Re: Attributed string in user defaults, is RTFD data OK?
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 31 Oct 2007 09:20:08 -0700


On Oct 31, 2007, at 9:00 AM, Jim Correia wrote:

I have an attributed string that I need to store via NSUserDefaults.

NSTextView uses RTFD data stream when passing this type of data around via the pasteboard. But typically the pastboard doesn't have to worry that someone is going to come alond and try to read the data with a different OS version :-)

Is the RTFD data format backwards (and forwards?) compatible? Or should I pick another format for storage in NSUserDefaults (or in a generic plist), such as an archived attributed string?

There are really two RTFD formats; one is the directory-based structure used for on-disk storage, and the other is the serialized data used on the pasteboard. The directory-based version is one of our common file formats, so it pretty much has to be compatible across versions; older OS versions should simply ignore newer tags that they don't recognize. The serialized data format is a fairly simple mapping of the directory-based one, so I think the same should apply to it. There are other choices, of course--for example, one could choose to use HTML, or a WebArchive if attachments are required; that would give you more contact with common standards, but potentially less fidelity to the capabilities of NSAttributedString.


Douglas Davidson

_______________________________________________

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


  • Follow-Ups:
    • Re: Attributed string in user defaults, is RTFD data OK?
      • From: Jim Correia <email@hidden>
References: 
 >Attributed string in user defaults, is RTFD data OK? (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Any better way to determine if file is executable?
  • Next by Date: Re: Attributed string in user defaults, is RTFD data OK?
  • Previous by thread: Attributed string in user defaults, is RTFD data OK?
  • Next by thread: Re: Attributed string in user defaults, is RTFD data OK?
  • Index(es):
    • Date
    • Thread