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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software