EOActionAssociation

Inherits From:
EOAssociation : EODelayedObserver : NSObject

Conforms To: NSCoding (EOAssociation)
EOObserving (EODelayedObserver)
NSObject (NSObject)

Declared in: EOInterface/EOActionAssociation.h

Class At a Glance:

Purpose

An EOActionAssociation displays no values, but instead sends a message to the objects selected in its EODisplayGroup when the display object, an NSControl or NSActionCell, sends its action.

Usable With

Any NSControl or NSActionCell

Aspects

action
Bound to a key that names a method implemented by the objects. The method must take no arguments if the argument aspect isn't bound, one argument if it is.
argument
An object attribute or relationship of the selected object, passed as an argument to the action method. (Usually bound to a different EODisplayGroup than that bound to action .)
enabled
A boolean attribute of the selected object, which determines whether the display object is enabled.

Object Keys Taken

target
On receiving an action message from the display object, an EOActionAssocation sends its action to the selected objects.

Class Description

EOActionAssociation allows you to set up an interface object, such as a button, to send a message to the selected objects when it's acted on.

Examples

Suppose you have an application that manages member accounts, each of which has a restriction on the outstanding balance allowed. Further, the Member class defines a boostRestrictions method that increases the limit by 20%. You can set up a button in the application to invoke this method by connecting it to the Member display group and binding the action aspect to the "boostRestrictions" key (which you add in Interface Builder).

In another scenario, one EODisplayGroup shows Members, while another shows video tapes available for rent. Here, you can bind a button to the Members EODisplayGroup with the action rentVideoTape: . Similarly, you bind the VideoTape EODisplayGroup to the argument aspect. Now, when the user selects a Member and a VideoTape and clicks the button, the Member is sent a rentVideoTape: message with the VideoTape.

Copyright © 1997, Apple Computer, Inc. All rights reserved.