• 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
NSAttributedString saved into NSUserDefaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAttributedString saved into NSUserDefaults


  • Subject: NSAttributedString saved into NSUserDefaults
  • From: Steve Sheets <email@hidden>
  • Date: Thu, 31 Mar 2005 16:20:46 -0500

I searched the archives for this question, but was unable to find any specific solution, so I thought I would come out and ask it.

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?

Obviously, one of the best way would be some function that converts NSAttributedString directly into a NSString, with embeded tags (ex. HTML?), while having another function that converts that resulting string back into an attributed string. I can not find anything from Apple for this simple operation.

Does anyone know how to do this? Or have sample code to do this?

I am mostly concerned with font name, font size, font styles, colors and other attributes. Pictures and URLs would not need to be converted or saved.

Any ideas? Sample code?

Thanks,

Steve Sheets
Midnight Mage Software


_______________________________________________ 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
  • Follow-Ups:
    • Re: NSAttributedString saved into NSUserDefaults
      • From: Satoshi Matsumoto <email@hidden>
    • Re: NSAttributedString saved into NSUserDefaults
      • From: Charilaos Skiadas <email@hidden>
    • Re: NSAttributedString saved into NSUserDefaults
      • From: Douglas Davidson <email@hidden>
    • Re: NSAttributedString saved into NSUserDefaults
      • From: John Brownlow <email@hidden>
  • Prev by Date: NSImageView.
  • Next by Date: Re: NSAttributedString saved into NSUserDefaults
  • Previous by thread: Re: NSImageView.
  • Next by thread: Re: NSAttributedString saved into NSUserDefaults
  • Index(es):
    • Date
    • Thread