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

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
Hi all,

I have a simple question:

How to show serial nos. or (row no. + 1) in a table column using cocoa bindings and array controller?
have made an application using cocoa bindings and array controller, in which I am displaying names of certain persons in a table column. The class from which I am displaying is named as: Person. Now I want to show serial nos. in first column, such that list gets displayed like this :

1 / John

2 / Peter

It is very easy to do if I use data source method:

Code:
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex

I just need to return something like this :

Code:
return [NSString stringWithFormat:@"%d",rowIndex+1];

but I am not getting how to do this via cocoa binding and array controller.

Can anyone suggest me solution for it?

Thanks,

Monaj
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.