• 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: Storing preferenses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Storing preferenses (From: Eivind Andersen <email@hidden>)

  • Prev by Date: Re: Storing preferenses
  • Next by Date: Authentication: Please critique my solution.
  • Previous by thread: Re: Storing preferenses
  • Next by thread: Re: Storing preferenses
  • Index(es):
    • Date
    • Thread