{"action":"opened","issue":{"url":"https://api.github.com/repos/SwiftBond/Bond/issues/247","repository_url":"https://api.github.com/repos/SwiftBond/Bond","labels_url":"https://api.github.com/repos/SwiftBond/Bond/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/SwiftBond/Bond/issues/247/comments","events_url":"https://api.github.com/repos/SwiftBond/Bond/issues/247/events","html_url":"https://github.com/SwiftBond/Bond/issues/247","id":144721264,"number":247,"title":"Cannot bind to NSButton state?","user":{"login":"ndevenish","id":529963,"avatar_url":"https://avatars.githubusercontent.com/u/529963?v=3","gravatar_id":"","url":"https://api.github.com/users/ndevenish","html_url":"https://github.com/ndevenish","followers_url":"https://api.github.com/users/ndevenish/followers","following_url":"https://api.github.com/users/ndevenish/following{/other_user}","gists_url":"https://api.github.com/users/ndevenish/gists{/gist_id}","starred_url":"https://api.github.com/users/ndevenish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndevenish/subscriptions","organizations_url":"https://api.github.com/users/ndevenish/orgs","repos_url":"https://api.github.com/users/ndevenish/repos","events_url":"https://api.github.com/users/ndevenish/events{/privacy}","received_events_url":"https://api.github.com/users/ndevenish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-30T21:12:17Z","updated_at":"2016-03-30T21:12:17Z","closed_at":null,"body":"I've created a simple window with a checkbox NSButton and a push NSButton. I've bound it with the checkbox to `checkButton` and the push button action to doOut, with the following controller:\r\n\r\n```swift\r\nclass ViewController: NSViewController {\r\n  @IBOutlet weak var checkButton: NSButton!\r\n  var checkStatus = Observable<Int>(0)\r\n  \r\n  override func viewDidLoad() {\r\n    super.viewDidLoad()\r\n    checkButton.bnd_state.bindTo(checkStatus)\r\n  }\r\n\r\n  @IBAction func doOut(sender: AnyObject)\r\n  {\r\n    Swift.print(\"Observed: \\(checkStatus.value)\")\r\n    Swift.print(\"Button:   \\(checkButton.state)\")\r\n  }\r\n}\r\n```\r\nI'd expect the `checkStatus` variable to mirror the button state. Upon running, without altering the checkbox:\r\n```\r\nObserved: 1\r\nButton:   1\r\n```\r\nHowever, after unchecking the box, the output is:\r\n```\r\nObserved: 1\r\nButton:   0\r\n```\r\ne.g. the status variable is not being updated beyond the initial bind (when it is synchronised once). \r\n\r\nHave I just misunderstood the binding altogether? The directions seems to be right, both because of examples and `NSTextView` instances seem to work fine. I've had similar behaviour trying to use `bnd_associatedObservableForValueForKey` to add a date binding to `NSDatePicker`, and ended up wrapping the event stream to get that to work (one-way)."}}