Forgive the super noob question, but I've been googling this for the past hour and am getting frustrated that I can't seem to find an answer to such a very basic question:
How do I handle control changes in Cocoa?
I'm coming from iOS, and it's clear that Cocoa does not use outlets or delegates to handle events in the same way that UIKit does and I feel like I'm just missing some very important piece of information here. I've figured out that it uses the first responder chain, but beyond that I can't figure out how to actually do it, or how to even find where these events are defined or documented.
So I have a NSSegmentedControl
inside a NSToolBar
and I just want to know when a user changes the selected segment. I've pored through the class documentation but cannot see a single mention of any kind of events or actions to handle. I did notice if I drag the control's action
outlet onto my first responder proxy, I get a quadrillion different actions listed, none of which seem relevant in any way.
How on earth do I do this in Cocoa?