Another problem where I’m stuck.
I have a table (an array controller)
If I select one row in the table I want to retrieve some data of the previous and next “row” of the data source - not the ones displayed in table view.
Off the top of my head: Calculate the indexes and then ask the array controller for arrangedObjects()'s objectAtIndex:theIndex (or objectsAtIndexes: if you want them together).
I still have no success. Don’t know what I’m doing wrong.
I have:
subsData
subsArrayController
subsTableView
The visible rows in the subsTableView might be filtered.
One row is selected.
Now I need the ‘row’ before and after the selected row from the original unfiltered data to retrieve some data from each which should be displayed leaving the table row selected.
set theIndex to subsArrayController's selectionIndex()
set preObject to subsArrayController's arrangedObjects()'s objectAtIndex:(theIndex - 1)
set postObject to subsArrayController's arrangedObjects()'s objectAtIndex:(theIndex + 1)
Sorry I missed the reply.
My question was misunderstood and (therfore) I misunderstood the replies as well. And as said before I misunderstood the ‘index’ thing.
I found simple solution but run into a ‘next’ problem and so I put this problem back to the shelf.