Copyright ã1996 by NeXT Software, Inc.  All Rights Reserved.

;CreatingAnInstanceOfYourClass.rtfd;;¬  Next Section	;NamingANewClass.rtfd;;¬  Previous Section

Specifyingoutletsandactions;¬Specifying outlets and actions

1	Click the button for an outlet or an action.

2	Select Outlets or Actions.

3	Choose the appropriate command from the Operations menu.

4	Enter the name of the outlet or action in place of the default name.

An object isolated from other objects is of little use. Interface Builder provides two ways for you to specify how objects of your class communicate with other objects: outlets and actions.

Before you begin this task, take a moment to consider what other objects you want instances of your class to send messages to, and the requests that instances of your class are apt to receive from other objects. The procedure itself is simple, and almost identical for outlets and actions. 

Adding Outlets

Outlets are instance variables that identify other objects. In the Classes display, you access the outlets of a class by clicking the electrical-outlet button.

¬

¬

When you press Return, the outlet is renamed and Interface Builder highlights the new outlet. If you have another outlet to specify, choose Add Outlet again from the Operations menu and type the outlet's name over the default name.

For background information on outlets and actions, see ªCommunicating With Other Objects: Outlets and Actionsº in Chapter€4, ªMaking and Managing Connections.º  ;../../02_CreatingTheInterface/04_Connections/ConnectionsConcepts.rtfd;CommunicatingWithOtherObjects:OutletsandActions;¬

Adding Actions

Actions are methods invoked as a direct consequence of the manipulation of NSControl objects in the interface, such as when users click a button. In the Classes display, you access a class's actions by clicking the cross-hairs button.

¬
¬

When you press Return, the action is renamed and Interface Builder highlights the new action. If you have another action to specify, choose Add action from the Operations menu, and type the new action's name over the default action name (ªMyActionº).

When you are finished specifying outlets and actions, click the class name to collapse the list of outlets and actions.

Tip: When an outlet or action (but not its text) is highlighted, you can add a new outlet or action by pressing the Return key instead of using the menu.