Hey guys, I'm trying to draw an NSImage in a NSCell using an NSTableView delegate method.
Here's what I'm trying:
I also am using the (float)tableViewNSTableView *)tableView heightOfRowint)row method, which works fine, but I can't figure out why the image won't draw. It places an object in the table, and it responds to double-clicks as my text objects do, but nothing is actually drawn, it's just a blank selectable space. Any pointers? Thanks!
Here's what I'm trying:
Code:
- (void)tableView:(NSTableView *)tableView
willDisplayCell:(id)cell
forTableColumn:(NSTableColumn *)column
row:(int)row
{
NSSize mySize;
mySize.width = 32;
mySize.height = 32;
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:[[[filesController arrangedObjects] objectAtIndex:row] valueForKey:@"filePath"]];
[icon setSize:mySize];
[cell initImageCell:icon];
[cell updateCell:cell];
[tableView reloadData];
}
I also am using the (float)tableViewNSTableView *)tableView heightOfRowint)row method, which works fine, but I can't figure out why the image won't draw. It places an object in the table, and it responds to double-clicks as my text objects do, but nothing is actually drawn, it's just a blank selectable space. Any pointers? Thanks!