Re: NSAttributedString saved into NSUserDefaults
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com 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 NSData data = [unarchiver transformedValue: theString]; etc [Disclaimer: typed into mail.app from memory] On Mar 31, 2005, at 4:20 PM, Steve Sheets wrote: -- 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 (Cocoa-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.apple... you encode it using -encodeWithCoder or whatever into NSData, and store the data (id) unarchiver = [NSValueTransformer NSUnarchiveFromDataValueTransformer]; 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? This email sent to site_archiver@lists.apple.com
participants (1)
-
John Brownlow