Causes the Apple event specified by the
to be dispatched to the appropriate Apple event handler, if one has been registered by calling set
.
SDK
- macOS 10.0+
Framework
- Foundation
Declaration
- (OSErr)dispatchRawAppleEvent:(const Apple Event *)theAppleEvent withRawReply:(Apple Event *)theReply handlerRefCon:(SRef Con)handlerRefCon;
Discussion
The the
parameter always specifies a reply Apple event, never nil
. However, the handler should not fill out the reply if the descriptor type for the reply event is type
, indicating the sender does not want a reply.
The handler
parameter provides 4 bytes of data to the handler; a common use for this parameter is to pass a pointer to additional data.
This method is primarily intended for Cocoa’s internal use. Note that dispatching an event means routing an event to an appropriate handler in the current application. You cannot use this method to send an event to other applications.