Problem Binding to UserDefaults
Problem Binding to UserDefaults
- Subject: Problem Binding to UserDefaults
- From: Peter Zegelin <email@hidden>
- Date: Thu, 2 Dec 2010 16:10:01 +1100
I am having trouble getting a change in a value in my preferences to be automatically saved, using bindings.
The defaults contain an array (called Workspaces) with two values: displayName and displayType ( which is a number ).
I have an arrayController that is bound to the Workspaces value in the SharedUserDefaultsController.
The displayName is bound to a table column via arraycontroller.arrangedObjects.workspaceName.
The displayType is shown as a segmented control and the control's selectedIndex is bound to the arrayController.selection.displayType ( ie to show which segment should be 'on' ).
This all loads and displays correctly. If I select a new row in the table then the segmented control updates etc. If I remove the selected item in the table via arrayController.remove then the user defaults are saved correctly.
However, if I change the displayType of the selected row via the control, then the results are *not* saved. The new value is correct while the app is running but never saved.
Can anyone suggest what I may be doing wrong?
thanks!
Peter Zegelin
http://www.fracturedsoftware.com
Rondo - MIDI for your mac
MacSimAVR - AVR microcontroller simulator for OS X
_______________________________________________
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