O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required