Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get the column index in -tableView:objectValueForTableColumn:row:

Can I get the current column index from the datasource method:

-tableView:objectValueForTableColumn:row:
like image 461
aneuryzm Avatar asked Mar 17 '15 12:03

aneuryzm


People also ask

How do you access the index of a column in a DataFrame?

You can use the loc and iloc functions to access columns in a Pandas DataFrame. Let's see how. If we wanted to access a certain column in our DataFrame, for example the Grades column, we could simply use the loc function and specify the name of the column in order to retrieve it.


1 Answers

You can search for the given NSTableColumn in the NSTableView columns...

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex {
    NSUInteger index = [[aTableView tableColumns] indexOfObject:aTableColumn];
    ...
}
like image 115
Marcos Crispino Avatar answered Oct 21 '22 05:10

Marcos Crispino