KD.
KD.

Reputation: 2055

How to add a selector to a menu item when using storyboard

I know how to do it programatically, creating a menu and adding menu items and then assigning selector to it and eventually calling a function. But what i am not able to figure out is how do i execute a function when an NSMenuItem was added using Story Board. enter image description here

All i want to do is when i click on "New ITEM" a function is called on the current controller.

Can you please suggest or point me to an example?

Upvotes: 3

Views: 1734

Answers (2)

vadian
vadian

Reputation: 285170

If the controller is in the responder chain hierarchy send the action to First Responder (the red cube). The method appears in the list if it's implemented in one of the responder chain objects.

Upvotes: 2

matt
matt

Reputation: 535746

Drag out a Sent Action from the Connections inspector.

enter image description here

Upvotes: 1

Related Questions