Hi all, I'm doing an application with NSOutlineView. I needed to display items in outlineview from a database in in which the outline column contains a checkbox and text. So I copied the the ImageAndTextCell class provided with the examples folder and then sets the images for checkbox. It is working fine. Now I added another column in outlineview with identifier as secondColumn for displaying the Country from database. Then I initialized an NSMutableArray to hold the Country names. Then in the outlineviews objectValueForTableColumn:method I did like:
- (id)outlineView
NSOutlineView *)outlineView objectValueForTableColumn
NSTableColumn *)tableColumn byItem
id)item {
if ([[tableColumn identifier] isEqualToString: @"firstColumn"])
{
return [(Node *)item name];
}
else if([[tableColumn identifier] isEqualToString
"secondColumn"])
{
NSLog(@"Country:%@",[record objectAtIndex:[outlineView rowForItem:item]]);
return[record objectAtIndex:[outlineView rowForItem:item]];
}
else return [item value];
}
It is not showing the second Column. The country name enters into the log file correctly. Where I got wrong ? How can I solve this?
Thanks in advance
- (id)outlineView
if ([[tableColumn identifier] isEqualToString: @"firstColumn"])
{
return [(Node *)item name];
}
else if([[tableColumn identifier] isEqualToString
{
NSLog(@"Country:%@",[record objectAtIndex:[outlineView rowForItem:item]]);
return[record objectAtIndex:[outlineView rowForItem:item]];
}
else return [item value];
}
It is not showing the second Column. The country name enters into the log file correctly. Where I got wrong ? How can I solve this?
Thanks in advance