• 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: Scott Ruda <email@hidden>
  • Date: Wed, 8 Oct 2003 11:53:06 -0700

On Wednesday, October 8, 2003, at 10:52 AM, <email@hidden> wrote:


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?

I'm not exactly sure what you mean by 'buddy-objects' but I found out that there are issues in NSDefaults regarding nested preference trees. I was actually doing this in CF and not NS, but I think it has the same issue:

From what I've been told, NSDefaults does not know about anything but the top-level objects of loaded preferences. You can not load a top-level container, traverse down into it, add or edit any leaf nodes, and then simply re-sync the top-level object. If you want to create a nested tree structure, you essentially need to copy the top-level container retrieved by NSDefaultsCopyValue into a MutableX object, traverse and edit that, and then write the whole new object back to NSDefaults.

If this sounds like the general area of your issues and you still have questions, let me know and I can give you more details.

Scott
_______________________________________________
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.

  • Prev by Date: DO: Setting Protocol before leaving server...
  • Next by Date: Re: Number formatting
  • Previous by thread: Re: Storing preferenses
  • Next by thread: DO: setRootObject
  • Index(es):
    • Date
    • Thread