Howdy,
On Feb 4, 2009, at 2:45 AM, Yang Mu wrote:
popupbuttoncell can show in table view.
but I don't know how to change default selection of popupbuttoncell.
it always select second item
another problem is when changing selection of popupbuttoncell, it
always back to before
if I make any mistake ,please give me some help
following is all codes for this problem:
-(void)awakeFromNib
NSPopUpButtonCell* cell = [NSPopUpButtonCell new]; [cell
addItemsWithTitles:[NSArray arrayWithObjects:@"One", @"Two",
@"Three", @"Four", @"Five", nil]];dataArray = [[NSMutableArray
alloc] init]; [dataArray addObject: cell];
-(int) numberOfRowsInTableView:
return [dataArray count];
- (id)tableView:objectValueForTableColumn:row:
NSPopUpButtonCell* cell = [muArray objectAtIndex:rowIndex];
[aTableColumn setDataCell:cell]; return popcell;
Please read up on the table view documentation. You want to return the
content for your cell, not the cell itself.
corbin
-(void)tableView:setObjectValue: forTableColumn: row:
NSPopUpButtonCell* cell = [muArray objectAtIndex:rowIndex];[cell
setObjectValue:anObject];
_______________________________________________
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