I am trying to add a double-click listener to mine NSTableViewfor each cell. Wherever I searched, it seems like this is done with help @selector, and all the source code was in Objective-C. I tried converting this code to Swiftto assign a method doubleActionto mine NSTableView, but it does not work (since my method is not called).
@IBOutlet var tableView:NSTableView?
override func awakeFromNib() {
let clSelector:Selector = "dblClk:"
tableView?.doubleAction = clSelector
}
func dblClk(sender:AnyObject){
println("ran")
}
Also my tableView has custom cells (in case that matters).
source
share