I have an NSTableView that I add objects to (through core data). I came across this in my searches:
NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:1];
[tableView selectRowIndexes:indexSet byExtendingSelection:NO];
which works, but the problem is when I replace 1 with [myarray count] it doesn’t select the last row.
My second question is when I have an IBAction hooked up to the table view to automatically call it when a row is selected, what is the sender? EDIT: Solved this one thanks to a good old NSLog
For the first question indexes are normally zero based. If I have
The count will be
4but the last index will be3.I’m not sure on the second answer I only know iOS at the moment.