Instance Method

sendAction:to:forAllCells:

Iterates through the cells in the receiver, sending the specified selector to an object for each cell.

Declaration

- (void)sendAction:(SEL)selector to:(id)object forAllCells:(BOOL)flag;

Parameters

aSelector

The selector to send to the object for each cell. This must represent a method that takes a single argument: the id of the current cell in the iteration. aSelector’s return value must be a BOOL. If aSelector returns NO for any cell, NSMatrix terminates immediately, without sending the message for the remaining cells. If it returns YES, NSMatrix proceeds to the next cell.

anObject

The object that is sent the selector for each cell in the matrix.

flag

YES if the method should iterate through all cells in the matrix; NO if it should iterate through just the selected cells in the matrix.

Discussion

Iteration begins with the cell in the upper-left corner of the receiver, proceeding through the appropriate entries in the first row, then on to the next.

This method is not invoked to send action messages to target objects in response to mouse-down events in the receiver. Instead, you can invoke it if you want to have multiple cells in an NSMatrix interact with an object. For example, you could use it to verify the titles in a list of items or to enable a series of radio buttons based on their purpose in relation to anObject.

See Also

Managing and Sending Action Messages

- sendAction

If the selected cell has both an action and a target, sends its action to its target.

doubleAction

The action sent to the target of the receiver when the user double-clicks a cell.

- sendDoubleAction

Sends the double-click action message to the target of the receiver.