Re: Binding NSPopUpButton
Re: Binding NSPopUpButton
- Subject: Re: Binding NSPopUpButton
- From: Todd Cash <email@hidden>
- Date: Mon, 9 Jan 2006 19:38:05 -0800
Jeremy,
I think I had the same problem as you and it took me forever to
figure out the answer.
In my application I have two array controllers -
ReminderIntervals - contains name/value pairs representing time
intervals (0 = minutes, 1 = hours, etc)
DataArray - this is the user entered records (one field of which
contains a RemainderInterval type)
I have a NSPopUpButton on my form that I want to display the
RemainderInterval name (i.e. Hours, Minutes, etc) but when the users
selects something from the list I want to store the value (i.e. 0, 1,
2, etc) in the DataArray controller.
Here's how I set up the bindings in Interface builder:
In the inspector window for the NSPopUpButton under the Bindings
settings I set up the following -
content
bind to: RemainderIntervals
controller key: arrangedObjects
model key path: leave blank
contentObjects
bind to: RemainderIntervals
controller key: arrangedObjects
model key path: typeID
contentValues
bind to: RemainderIntervals
controller key: arrangedObjects
model key path: typeDescription
selectedObject
bind to: DataArray
controller key: selection
model key path: remainerIntervalType
Hope this helps,
Todd
_______________________________________________
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