I add an Image & Text Table Cell View to NSTable in IB. There is a TextFiled and a ImageView in the Text Table Cell View, so my code looks like this:
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row{
NSString *iden = [ tableColumn identifier ];
if ([iden isEqualToString:@"MainCell"]) {
NSTableCellView *cell = [ tableView makeViewWithIdentifier:@"MainCell11" owner:self ];
[cell.textField setStringValue:@"123"];
[cell.imageView setImage:[[NSImage alloc] initByReferencingFile:@"/Users/Pon/Pictures/17880.jpg"]];
return cell;
}
return nil;
}
I found that textfield and imageView has default outlet, so I can use cell.textFiled to visit this textField Object and change the value of it. Here is my question, if I add an extra TextField to this Image & Text Table Cell View, there is two TextField in one column, so how can I get the second TextFiled which added by me, change the TextFiled's value?