Creating and Connecting an Action
Choose View > Assistant Editor > Open Assistant Editor.
In the primary editor, open the user interface document that contains the object that invokes the new action.
In an assistant editor, open the header file to which to add the action-method declaration.
Control-drag from the object to the header file.
Choose Action from the Connection menu.
Enter the name of the action method, and click Connect.
Connect an object to the declaration of a new action method in a header file.
As you Control-drag from an object to your source code, Xcode indicates where a new action is valid. After you enter the name of the action, Xcode declares the action for you and connects the object to it.
Xcode also inserts a skeletal definition for the new action in the implementation file. You need to add the source code that implements the action. You can Option-click the name of the implementation file in the source editor’s jump bar to open the implementation file alongside the header file.
The video shows connecting a button matrix to a new action in a window controller class.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)