• 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: NSTableView/NSPopUpButtonCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView/NSPopUpButtonCell


  • Subject: Re: NSTableView/NSPopUpButtonCell
  • From: Brian Webster <email@hidden>
  • Date: Wed, 26 Mar 2003 16:35:40 -0600

On Wednesday, March 26, 2003, at 12:40 PM, email@hidden wrote:

However, what I don't get is how to retrieve the selected value from
the popup since the sender to my method is the NSTableView. What I
actually need is the title of the menu item that the user has selected.
Also, in tableView:objectValueForTableColumn:row: I have no idea what
to return when the popup column is the one to be refreshed from my data
source.

The easiest way to handle getting and setting values from pop-ups in a table view is through the tableView:objectValueForTableColumn:row: and tableView:setObjectValue:forTableColumn:row: methods. The object value in this case is going to be an NSNumber containing the index of the item to be selected in the menu. So, use the data source method instead of the action method to handle selections, and return the appropriate number for the object value for each row and you should be in business.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Mysterious Build Error
  • Next by Date: Re: Mysterious Build Error
  • Previous by thread: Re: Mysterious Build Error
  • Next by thread: Re: [OT] Macho Love
  • Index(es):
    • Date
    • Thread