NSUserDefaultsController problems
NSUserDefaultsController problems
- Subject: NSUserDefaultsController problems
- From: Brian Stern <email@hidden>
- Date: Fri, 21 Apr 2006 13:57:45 -0400
Howdy,
I'm implementing a preferences window similar to the XCode prefs window.
The prefs are bound to the shared NSUserDefaultsController. In one of the
pref panels I have a setting that can only be set one time; after that
changes in the UI aren't written out.
The UI is essentially a master-detail UI. The master is a Popup menu
showing a list of categories and the detail is a second Popup showing a
property of the selected category. The data model for the categories is an
NSArray containing an NSDictionary for each category. The dictionary
contains strings for keys of category_name and property_name. The data
model for the detail is a second NSArray containing NSDictionaries. Each
dictionary contains a string for a key of detail_property_name.
There is a category NSArrayController bound to NSUserDefaults and a
property NSArrayController also bound to NSUserDefaults.
The category Popup has content and contentValues bound to the category
NSArrayController and selectedIndex is bound to selectionIndex in the
category controller.
The detail Popup has content and contentValues bound to
arrangedObjects.detail_property_name in the property controller. It has
selectedValue bound to selection.property_name in the category
NSArrayController.
Everything seems to display as expected: categories are shown in the master
popup; the several properties are listed in the property popup; the
selected property for a category is shown in the detail popup if I change
the category.
The problem is that I can only set the property for a given category one
time. After app launch I can change the property in the property popup any
number of times and the current selected property is written out to the app
defaults file when I click save (which calls[[NSUserDefaultsController
sharedUserDefaultsController] save:self];) After that any changes to the
property popup have no effect on what is written out to the user defaults
file until the app restarts. In fact notifications are sent when the popup
is changed indicating that selection.property_name was changed but its
value doesn't change.
What could be the cause of this problem?
--
Brian Stern
email@hidden
_______________________________________________
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