On Jul 18, 2010, at 16:32, Robb wrote: > I'm trying to setup a table view with multiple columns, but I can't figure > out how to identify any particular column. > what does [tablecolumn identifier] actually return so i can compare it? I > assumed a string, but that didn't work. So my questions is, what do I do > with the NSTableColumn thats being passed to me? > > Here is the method so far: > > - (id) tableView:(NSTableView *) tv > ObjectValueForTableColumn:(NSTableColumn *) tc > row:(int) index > { > if ([tc identifier] == @"Integer") { > return [integerArray objectAtIndex:index]; > } > if ([tc identifier] == @"Cube") { > return [cubeArray objectAtIndex:index]; > } > if ([tc identifier] == @"Square") { > return [squareArray objectAtIndex:index]; > } > }
You've mis-spelled the method name (it's 'objectValueForTableColumn', not 'ObjectValueForTableColumn'). The table column *is* a string (assuming you've set it in IB), but you're doing pointer comparisons in your code, not string comparisons. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com