Mat*_*att 3 view nstableview swift
我有一个NSTableCellView包含嵌入的NSProgressIndicators 和NSButtons的自定义s表,我想在单击后立即更新,并在计时器上定期更新。这是迄今为止我的代码示例:
func sound(sound: NSSound, didFinishPlaying aBool: Bool) {
pbNowPlaying.doubleValue = sound.currentTime
if aBool == true {
self.btnPlay.stringValue = "Play"
self.btnPlay.state = NSOffState
self.pbNowPlaying.doubleValue = 0
}
self.needsDisplay = true
}
Run Code Online (Sandbox Code Playgroud)
这个(和其他self.needsDisplay = true设置的代码)似乎没有更新视图。当我手动重新加载表数据时,进度条移动(已绑定到NSSounds.currentTime值),但按钮文本/状态不会改变。
有什么建议吗?
使用 Swift、Xcode 6.4、OS X 10.10.4 进行编码
| 归档时间: |
|
| 查看次数: |
1363 次 |
| 最近记录: |