Re: NSTableView/NSPopUpButtonCell
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.