Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mahaboob

macrumors member
Original poster
Jul 10, 2008
31
0
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:mad:"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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.