• 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
Re: Binding NSPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Silencing beeps from nonexistent key equivalents
  • Next by Date: Re: Silencing beeps from nonexistent key equivalents
  • Previous by thread: Re: Binding NSPopUpButton
  • Next by thread: ANN: CSMail client-based mail delivery framework released
  • Index(es):
    • Date
    • Thread