【发布时间】:2017-08-24 13:17:47
【问题描述】:
我使用 swift 4 for osx。 我有带有自定义单元格的 nsoutlineview。 每个单元格中都有一个按钮。
在我的 outlineView-Controller-Class 中是这个按钮的 IBAction 动作:
@IBAction func showInfo(_ sender: NSButton) {
// Get the row of clicked button
print(myOutlineView.row(for: sender as NSView))
}
但我也想选择此按钮所在的行。 我想我必须使用这个命令:
myOutlineView.selectRowIndexes(<NSIndexSet>, byExtendingSelection: <Bool>)
但是我怎样才能得到 NSIndexSet 的值呢?
【问题讨论】:
标签: swift macos cocoa nsoutlineview