Table view data source methods order?
Table view data source methods order?
- Subject: Table view data source methods order?
- From: Chase Meadors <email@hidden>
- Date: Mon, 3 Aug 2009 00:04:59 -0500
I'm having a bit of trouble here with table view data source methods.
I have implemented. I have these three:
1) - (NSCell *)tableView:(NSTableView *)sender dataCellForTableColumn:
(NSTableColumn *)tableColumn row:(NSInteger)row;
2) - (id)tableView:(NSTableView *)sender objectValueForTableColumn:
(NSTableColumn *)tableColumn row:(NSInteger)row;
3) - (void)tableView:(NSTableView *)sender willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex;
I'm having trouble implementing what I want to implement. One column
in my table view has some popup cells that have unique items to select
from. In method 1) I'm returning a generic NSPopUpButtonCell if
appropriate.
In method 2), I return an index based on a string in the list of
values for that row.
In method 3), if the cell is one of my popups, I set it's menu to the
list of values for that row.
Here's the problem. I'm returning the correct index for an object
value in 2), but all of my popups have index 0 selected (with the
correct list). The only reason I can think of is that cocoa follows
this order:
1) call -objectValueFor...
2) THEN set the object value while the cell doesn't have it's list,
3) THEN call willDisplayCell...
Is there some way to implement this? They could simplify things by
just giving direct access to the cell in the objectValueFor... method.'
Any help appreciated, thanks!
P.S. I did try to eliminate objectValueFor... and do everything in -
willDisplayCell, but this doesn't work.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden