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

Re: NSAttributedString saved into NSUserDefaults


  • Subject: Re: NSAttributedString saved into NSUserDefaults
  • From: Satoshi Matsumoto <email@hidden>
  • Date: Fri, 01 Apr 2005 08:45:19 +0900

on 05.4.1 6:20 AM, Steve Sheets at email@hidden wrote:
> How can NSAttributedString be saved/converted in the User Defaults (ie.
> Preferences)?

I think following is the simplest code for you.

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

//Saving:
[defaults setObject:[NSArchiver archivedDataWithRootObject:attrString]
forKey:YourKey];

//Loading:
attrString =[NSUnarchiver unarchiveObjectWithData:[defaults
objectForKey:YourKey]];

Satoshi
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802


 _______________________________________________
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

References: 
 >NSAttributedString saved into NSUserDefaults (From: Steve Sheets <email@hidden>)

  • Prev by Date: Re: Nested sheets
  • Next by Date: NSTableView lost focus detection
  • Previous by thread: Re: NSAttributedString saved into NSUserDefaults
  • Next by thread: Bindings aware progress indicator in table column?
  • Index(es):
    • Date
    • Thread