Instance Method

setEventHandler:andSelector:forEventClass:andEventID:

Registers the Apple event handler specified by handler for the event specified by eventClass and eventID.

Declaration

- (void)setEventHandler:(id)handler andSelector:(SEL)handleEventSelector forEventClass:(AEEventClass)eventClass andEventID:(AEEventID)eventID;

Discussion

If an event handler is already registered for the specified event class and event ID, removes it. The signature for handler should match the following:

- (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent;

See Also

Working with event handlers

- removeEventHandlerForEventClass:andEventID:

If an Apple event handler has been registered for the event specified by eventClass and eventID, removes it.