【发布时间】:2016-01-30 22:29:09
【问题描述】:
如何获取NSTableView中之前选中的行索引
方法
func tableViewSelectionIsChanging(notification: NSNotification) {
let index = (notification.object as! NSTableView).selectedRow
println(index)
}
func tableViewSelectionDidChange(notification: NSNotification)
let index = (notification.object as! NSTableView).selectedRow
println(index)
}
两种方法都打印相同的值。如何获取将因选择而改变的索引/行?
或者简单来说,我该怎么做这样的陈述
println("\(Selection changed from \(tableView.oldSelectedIndex) to \(tableView.newSelectionIndex)")
【问题讨论】:
标签: macos cocoa nstableview