Re: NSAttributedString saved into NSUserDefaults
Re: NSAttributedString saved into NSUserDefaults
- Subject: Re: NSAttributedString saved into NSUserDefaults
- From: John Brownlow <email@hidden>
- Date: Thu, 31 Mar 2005 16:27:57 -0500
you encode it using -encodeWithCoder or whatever into NSData, and store
the data
then when you retrieve it from the defaults you decode it
also works with fonts, colors etc.
or you can use the built in NSValueTransformer
(id) unarchiver = [NSValueTransformer
NSUnarchiveFromDataValueTransformer];
NSData data = [unarchiver transformedValue: theString];
etc
[Disclaimer: typed into mail.app from memory]
On Mar 31, 2005, at 4:20 PM, Steve Sheets wrote:
How can NSAttributedString be saved/converted in the User Defaults
(ie. Preferences)? Is there a way to convert NSAttributedString (ie.
text containing fonts, font size, colors and other text attributes)
into a NSString, and then saved into a NSAttributedString? And then
later be able to read it out of the applications user defaults back
into a NSAttributedString with the font information restored?
--
John Brownlow
Deep Fried Films, Inc
http://www.johnbrownlow.com
http://www.pinkheadedbug.com
_______________________________________________
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