NSTableView Delegate Called But Data not showing

1.4k views Asked by At

i have a very strange problem with NSTableView in XCode 4.2. I've set the datasource an delegate for the table. My table has 3 columns where each of the column has an identifier ("name","mugshot","lastSeen"). My delegate

-(id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row

is being called, but there is still the default value "TableViewCell" shown in the table cells. the method is implemented as follows:

- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
{
    NSMutableDictionary *villain = [self.villains objectAtIndex:row];
    id keyName = [tableColumn identifier];
    id objectValue = [villain objectForKey:keyName];
    return objectValue;
}

The tableColumnIdentifier is correct. I have no idea why the text is not showing.

br, martin

1

There are 1 answers

1
Mike K On BEST ANSWER

in interface builder, make sure the Table Column contains a "Text Field Cell". if not, try dragging out a Text Field Cell on top of whatever cell is there.

this is assuming objectValue is an NSString?