Contents

AXObserverCreate(_:_:_:)

Creates a new observer that can receive notifications from the specified application.

Declaration

func AXObserverCreate(_ application: pid_t, _ callback: AXObserverCallback, _ outObserver: UnsafeMutablePointer<AXObserver?>) -> AXError

Parameters

  • application:

    The process ID of the application.

  • callback:

    The callback function.

  • outObserver:

    On return, an AXObserverRef representing the observer object.

Return Value

If unsuccessful, AXObserverCreate may return one of the following error codes, among others:

kAXErrorIllegalArgument

One or more of the arguments is an illegal value.

kAXErrorFailure

There is some sort of system memory failure.

Discussion

When an observed notification is received, it is passed to AXObserverCallback.

See Also

Notification API