I have an NSTableView which is bound to an NSArrayController. I would like to have one of the table columns showing the index of the table row. This is easy enough to do when you implement NSTableDataSource yourself but I can't figure it out with a bound table view. I guess I'm looking here for something like the @count key path which gives me the count of arrangedObjects (that is @index) but this is obviously missing.
Two clarifications:
- The index that is shown in each row is the index of that row and not related at all to the way the data is actually arranged in the model or array controller. For example, if the whole data is 10000 items then the indexes should go from 1 to 10000, if the user enters a search term and the table is showing only 4 of the items then the numbers should go from 1 to 4, even if the items shown are actually from all over the original array.
- I need this because I was asked to do this by the client :-). The client needs a way to be able to estimate the number of rows before or after a certain row. Hi might, for example, want to know how many rows were added.