Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Attributed string in user defaults, is RTFD data OK? (From: Jim Correia <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.