• 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
Array of Preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Array of Preferences


  • Subject: Array of Preferences
  • From: "Frank D. Engel, Jr." <email@hidden>
  • Date: Wed, 18 Mar 2009 20:14:37 -0400

I have an interesting puzzle on my hands, hoping someone here can help.

I want to store an array of dictionaries as preferences.

Each dictionary will have two keys; one is a string which will appear in an NSTableView for identification purposes.


My initial approach here was to create an NSArrayController using Interface Builder, leave the class name at the default NSMutableDictionary, and bind the NSTableView column to that controller, using the key for each dictionary within the array.


The NSArrayController has its Content Array bound to Shared Defaults using a key I picked for storing in the preferences file.


This all goes fine until I try to rename the dictionary (change that bound string) within the table view. While the name changes in the view, if I retrieve the array and append a new object, then set the preferences back, using code, all of the names revert back to the originals.



I think what may be happening is that the table view is getting the dictionary objects from the array controller and updating the keys of the dictionary, but the dictionary itself never gets synced back to the preferences?


Any thoughts on an easy way around this?


I did check "Continuously Updates Value" for the column's binding, but that seems to make no difference.



Thank you for any advice on this!


----------------------------------------------------------- Frank D. Engel, Jr. <email@hidden>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.
$



__________________________________________________ D O T E A S Y - "Join the web hosting revolution!" http://www.doteasy.com _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Array of Preferences
      • From: Steven Riggs <email@hidden>
  • Prev by Date: Re: NSTableView behavior changes
  • Next by Date: Re: Array of Preferences
  • Previous by thread: Re: How does OS X launch login items hidden?
  • Next by thread: Re: Array of Preferences
  • Index(es):
    • Date
    • Thread