aneuryzm
aneuryzm

Reputation: 64854

Is there a way to get the NSCell object given the row and column indexes of the selected cell a table?

Is there a way to get the NSCell object given the row and column indexes of the selected cell a table?

I can't use the NSTableView delegate methods, such as tableView:willDisplayCell:forRowAtIndexPath: because I need to get the cell object in this method:

- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex

thanks

Upvotes: 0

Views: 514

Answers (1)

Hussain Shabbir
Hussain Shabbir

Reputation: 15025

Yes it is possible try this below :-

- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
    NSCell *cell=[aTableView preparedCellAtColumn:[aTableView selectedColumn] row:rowIndex];
    NSLog(@"%@",cell);
    return YES;
}

Upvotes: 1

Related Questions