I've read a lot about this but i can't get it to work, i have a custom NSCell with this code
#import "ServiceTableCell.h"
@implementation ServiceTableCell
-(void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSLog(@"I'm being called");
NSView *newview = [[NSView alloc] initWithFrame:cellFrame];
NSImage *image = [NSImage imageNamed:@"bg.png"];
NSRect imagesize;
NSImageView *IMV = [[NSImageView alloc] initWithFrame:imagesize];
[IMV setImage:image];
[newview addSubview:IMV];
[controlView addSubview:newview];
}
And this my NSTableView data source:
- (long)numberOfRowsInTableView:(NSTableView *)tableView {
return 3;
}
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(long)row
{
return [[ServiceTableCell alloc] initTextCell:@"dd"];
}
As i understand, the drawwithframe... gets called when the cell is initialized but it never gets called, so, what am I missing?