How to make NSArrayController preservesSelection work for custom object?
问题 I have a Cocoa app with a view-based table view bound to an NSArrayController with a list of custom Employee objects. The table view shows the list of employees. In a subview, the employee's details can be changed. Everything is set up, so that when an employee's details are changed, the table view contents are reloaded, showing the changes. So far, so good. Now NSArrayController has the ability to preserve the selected object across reloads via preservesSelection . For my custom Employee