I've encountered a problem while creating an NSTableView with 2 columns.
How do you set the value of the a row's corresponding column?
I would like to have colText
to be in the row's column, but it seems nearly impossible to achieve.
Here's the code:
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex {
uint32_t size = *((uint32_t *)[[itemSizes objectAtIndex:rowIndex] bytes]);
NSString *colText = [NSString stringWithFormat:@"%d bytes", size];
return [objNames objectAtIndex:rowIndex];
}
I would like [objNames objectAtIndex:rowIndex]
to be in the left column, which it is, and colText
on the right?
I'm a bit stuck.
Any help appreciated.