views:

31

answers:

0

I am using Core Data to manage objects and using a NSTableView to display those objects. The table columns are binded to objects' properties through a NSArrayController.

When users click the delete button, all selected objects in the NSTableView will be deleted. Then only remained objects are left in the NSTableView.

This works smoothly. But after deleting selected rows, NSTableView does not select a row automatically. As a result, users have to type once arrow key or use mouse to select a new row.

So my question is: how could I make NSTableView select the next or previous row after selected rows are deleted?

Of course, I could just select a left row programmatically after deleting. But I am wondering whether there is a more elegant way to achieve this.

Thanks