Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Aug 27, 2013, 11:47 PM   #1
macrumors 6502
Join Date: Jan 2009
NSUserDefaults, Bindings, NSPopup Button Question

Hi all
I am looking for help with this, possibly am using the wrong approach. The setting is as follows.
1) I register a "Factory" default (in this case the index of an initial popUpButton (an NSNumber)) for a key.

2) In the xib, an NSArrayController's content binds to an NSArray.

3) In the Xib, the popUp Button's content Values binds to the "arrangedObjects" of the controller.

4) In the Xib, the popUP Button's selectedIndex binds to the Shared User defaults controller whose modelKeyPath is the key in (1) above.

All this works as expected. The initial popUP is the "Factory" value, and subsequent values of the popUPButton are the last value chosen before quitting.

Now...I would like to access the current value of the popUpButton. Prior to binding to the userDefaultsController, I had bound the button's selectedValue to a property in the controller.m file. Currently this is not possible, as binding the selectedIndex disables the selectedValue.
I am sure this is not a new problem, but what approach would those who work with bindings suggest.
(What I am after is once the user has selected a particular popupButton value, this be reflected in a model "property").
thanks in advance.
mdeh is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
textfield value not getting saved to nsuserdefaults abcdefg12345 Mac Programming 5 May 8, 2014 06:43 PM
Mophie Juice Pack Plus (iPhone 5) Question - Mute Button Question JulesK iPhone Accessories 3 Mar 30, 2014 02:58 PM
Bindings question: default value Qaanol Mac Programming 4 Nov 20, 2013 12:15 PM
NSUserDefaults(Controller) davidmirv Mac Programming 3 Apr 17, 2013 03:29 PM
NSCoding/NSUserDefaults nashyo iPhone/iPad Programming 5 Jun 25, 2012 05:41 AM

Forum Jump

All times are GMT -5. The time now is 05:31 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC