Instance Method

addTargetWithHandler:

Adds a block to be called when an event is received.

Declaration

- (id)addTargetWithHandler:(MPRemoteCommandHandlerStatus (^)(MPRemoteCommandEvent *event))handler;

Parameters

handler

A block object to handle the MPRemoteCommandEvent.

Return Value

An opaque object associated with the designated handler.

Discussion

Call the addTargetWithHandler: method to add a block to be called. Remove the handler by calling the removeTarget: method, passing in the object returned by this method.

See Also

Handling Events

- addTarget:action:

Adds a target object to be called when an event is received.

- removeTarget:

Removes a target from the remote command object.

- removeTarget:action:

Removes a target and action from a remote command object.

MPRemoteCommandHandlerStatus

Constant indicating the status of a command.