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?
What I usually do is create a new menu item in your application's menu bar. Something like:
File -> Delete ${Name of Item}
Then you can link that NSMenuItem
in Interface Builder to point to an IBAction method defined somewhere on either your app delegate or some other controller. The implementation for this method should delete the item from your model, and refresh the NSTableView
.
The advantage to making an NSMenuItem
out of the action is that: