On May 20, 2010, at 1:14 PM, James Maxwell wrote:

> I thought I'd change the topic on this, since the content really has changed.
> 
> I have an table for setting up MIDI instruments with a name, port, and 
> channel. I've got the initial display of options for the table row displaying 
> correctly, and when I make changes to the name, port, and channel, the data 
> object is updated correctly. The only thing left is that the popups in 
> columns 2 and 3 are not holding the selected value. I understand that this is 
> probably because I'm reloading the menu in 
> tableView:objectValueForTableColumn:row, but I'm not sure how to get around 
> it. 
> 
> Here's the code I've got so far. I'm not using an NSArrayController, because 
> that approach was driving me absolutely mental...
> I've copied all the code (except imports) to be thorough. Logging "Edited 
> MIDIInstrument" at the end shows that the instrument is set up correctly, 
> with the desire name, port, and channel. It's just that the popups always 
> display the 2nd item.

Hi James,

If you have a table view containing an NSPopUpButtonCell, the object value 
returned by your objectValueForTableColumn: method should be an NSNumber, which 
contains the index of the item that should be selected.  It looks like the 
attached code is returning the cell itself, which is strange, and I think 
that's causing the problem.

Hope this helps,
-Peter

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to