I’m looking for an easy solution to delete NSTableView rows by pushing the delete key.
All I have seen when searching in Google were answers like this:
http://likethought.com/lockfocus/2008/04/a-slightly-improved-nstableview/
This seems to me an Engineering solution, but I would like to know if this is the best way. Does any one know a better answer?
I’ve implemented something similar to
LTKeyPressTableView. However, I use array controllers, so in my subclass I addedIBOutlet NSArrayController * relatedArrayController. Instead of handling delete request in a delegate, I handle it directly in the subclass since my subclass specifically deals with adding handling of Delete key. When I detect keypress for delete key, I’m just calling[relatedArrayController delete:nil];.IRTableView.h:
and IRTableView.m:
End result is quite IB-friendly for me, and a quite simple solution for use in a Cocoa Bindings+Core Data application.