Name

NSAppleEventManager — Mac OS X 10.0

Synopsis

This class is used to register objects as handlers of raw Apple Events in a Cocoa application. Instances of this class are not only responsible for registering and unregistering handlers, but are also responsible for dispatching events to the appropriate handler object. An application has a single instance of NSAppleEventManager that is shared among its objects; this event manager is obtained using the class method sharedAppleEventManager.

image with no caption

@interface NSAppleEventManager : NSObject
                                  // Accessor Methods
   - (void)setEventHandler:(id)handler 
                                 andSelector:(SEL)handleEventSelector 
                                 forEventClass:(AEEventClass)eventClass
                                 andEventID:(AEEventID)eventID;
                                  // Class Methods
   + (NSAppleEventManager *)sharedAppleEventManager;
                                  // Instance Methods
   - (OSErr)dispatchRawAppleEvent:(const AppleEvent *)theAppleEvent 
                                 withRawReply:(AppleEvent *)theReply
                                 handlerRefCon:(UInt32)handlerRefCon;
   - (void)removeEventHandlerForEventClass:(AEEventClass)eventClass 
                                 andEventID:(AEEventID)eventID;

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.