Question

I'm trying to connect a UI element in a window to my app's controller/delegate using the Assistant editor, but there is no option to create a new IBOutlet/IBAction when dragging from the UI element to the interface file.

The File's Owner of the window is NSWindow, and its not my main menu (which is a NSMenu on a NSStatusItem, if that helps). The main menu's UI elements works perfectly fine. When my application is run, the window is opened when expected with all UI elements in place, but because I can't connect them, they don't call any methods and are not changed.

No connection is made when dragging from the interface file to the UI element (even when right clicked) or to the Connections Inspector or the other way around. I've tried regular dragging and control dragging too.

How can I connect the UI element to its IBOutlet (for changing state programmatically) and IBAction (for receiving the user's change of state)? Am I not selecting the UI element correctly? Do I need to be dragging to a different spot?

On the Connections Inspector, where should I be dragging from/to?

Is there any other way I can connect it that should work? Is there other things I can try?

Example of no new connection being made

EDIT: When I control drag to an already existing outlet, it gives me the option to make a binding.

EDIT2: Upon further troubleshooting, I've found that this applies to all UI elements, not just checkboxes.

Was it helpful?

Solution

You need to connect your outlets to the File's owner for this to work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top