• 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
Problem Binding to UserDefaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Problem Binding to UserDefaults
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Getting current mouse position after scroll
  • Next by Date: Re: Getting current mouse position after scroll
  • Previous by thread: Re: Getting current mouse position after scroll
  • Next by thread: Re: Problem Binding to UserDefaults
  • Index(es):
    • Date
    • Thread