NSPopUpButtonCell trouble
NSPopUpButtonCell trouble
- Subject: NSPopUpButtonCell trouble
- From: Devon E Bowen <email@hidden>
- Date: Wed, 8 Jun 2005 14:50:44 -0400 (EDT)
I'm having a problem getting NSPopUpButtonCells to accept my data source
in an NSTableView. I set up a table and dragged the NSPopUpButtonCell to
one of the colums in IB. Since it seems you can't set the items in the
button via IB, I do that in the awakeFromNib:
NSPopUpButtonCell *popup =
[[[tableView tableColumns] objectAtIndex:1] dataCell];
[popup addItemWithTitle:@"A"];
[popup addItemWithTitle:@"B"];
[popup addItemWithTitle:@"C"];
This seems to work fine. Except that all the buttons always show "A" as
the current value even when I tell it otherwise. It does call my
tableView:objectValueForTableColumn:row:
method as it should and I return an NSNumber with the item number that
I want shown. But it just ignores it. When I select, say, C from one of
the buttons, it does call
tableView:setObjectValue:forTableColumn:row:
and passes to me what appears to be an NSNumber with the value 3. But
then when I pass exactly this object back again, it still doesn't hold
that item in the button. Any idea what I'm doing wrong? What kind of
object am I supposed to be sending to indicate the value? Thanks.
Devon
_______________________________________________
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