Re: NSAttributedString saved into NSUserDefaults
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