On 2010 Jun 12, at 11:25, Adam Gerson wrote: > the problem I am having is that [checkboxB setState:0] only changes the value > on the screen but does > not update the defaults saved value in the file
Maybe the change is being deferred until later. Tried -[NSUserDefaults synchronize]? > I have set up some NSUserDefaults and used bindings to bind them to > some checkboxes and radiobuttons in my nib. I want the act of checking > some of the checkboxes to uncheck or check other checkboxes. I did > this by registering for a NSUserDefaultsDidChangeNotification. Although I'm not saying it can't work, that doesn't seem very elegant. > What is the right way to achieve this kind of one checkbox dependent > on anothers value with NSUserDefaults and bindings? I believe that if you need something more complicated than can be directly done with bindings (such as enabling checkbox B if checkbox A is checked), then a more conventional approach would be to write a little controller class and interpose it between your view and NSUserDefaults. I seem to recall that NSUserDefaults has some documented but unexpected behaviors with bindings, and it's best not to get too innovative in this area. _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
