Re: Storing preferenses
Re: Storing preferenses
- Subject: Re: Storing preferenses
- From: publiclook <email@hidden>
- Date: Wed, 8 Oct 2003 10:24:28 -0400
Only certain types can be directly stored in property lists and the
defaults database is just a property list.
You can store any object that conforms to the NSCoding protocol in a
property list by simply archiving it into NSData and storing the NSData
in the property list.
Using
http://cocoa.mamasam.com/ to search the list archives reveals the
following prior threads on this topic:
http://cocoa.mamasam.com/COCOADEV/2002/07/2/40993.php
http://cocoa.mamasam.com/COCOADEV/2002/05/1/33566.php
In your case, you could simply archive the entire array containing
buddy objects and store the archived array in defaults.
On Wednesday, October 8, 2003, at 08:24 AM, Eivind Andersen wrote:
Hi, and thank you for the help!
I switched to using the NSUserDefaults. It sure made the code more
compact :), but the problem is still there. When I try to save the
buddylist (a NSMutableArray containing "Buddy-objects"), it is empty
when I extract it. Everythings works well with stringobjects.
It there a trick to saving/extracting NSMutableArrays from
NSUserDefaults?
Best regards,
Eivind Andersen
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.