Key Value Observing and NSButton state

自古美人都是妖i 提交于 2019-12-05 20:15:43

In -awakeFromNib check that myCheckbox is not nil. If it's nil then it's not connected properly in IB.

Edit:

The correct keypath is "cell.state".

Unless documented to be Key Value Observing compliant, you should not expect the accessors of a given class to implement KVO support.

Buttons do implement key value binding, so instead of observing the state property you might bind one of your boolean attributes to the button's value binding.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!