• 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 a popup button's selected index to a model integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding a popup button's selected index to a model integer


  • Subject: Re: Binding a popup button's selected index to a model integer
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 29 Apr 2008 12:25:52 -0400

>  I would appreciate some guidance in getting a popup button to use its
> selectedIndex to set an integer in my model.

  Am I correct in assuming you want your popup to represent the
-gameType of the selected item in the array controller?

  If so, the best thing to do is to create an NSObjectController
instance and bind its content object to the array controller's
selected object (via the array controller's 'selection' key). Bind
your popup's -selectionIndex to your object controller's -gameType key
(which reprsents the gameType of the selection of the array of (I
assume) games or whatever.

  Using this mechanism, the object controller always represents the
selected object of your array controller which makes things a hell of
a lot easier to manage. :-)

--
I.S.
_______________________________________________

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

References: 
 >Binding a popup button's selected index to a model integer (From: Johnny Lundy <email@hidden>)

  • Prev by Date: Binding a popup button's selected index to a model integer
  • Next by Date: Re: Counting instances in Core Data
  • Previous by thread: Binding a popup button's selected index to a model integer
  • Next by thread: Any actor or coroutine implementations for Cocoa?
  • Index(es):
    • Date
    • Thread