---
title: "AXObserverCreate(_:_:_:)"
framework: Application Services
role: symbol
role_heading: Function
platforms: [macOS 10.2+]
path: applicationservices/1460133-axobservercreate
---

# AXObserverCreate(_:_:_:)

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

## Declaration

```swift
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

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

## Discussion

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

## See Also

### Notification API

- [AXObserverAddNotification(_:_:_:_:)](applicationservices/1462089-axobserveraddnotification.md)
- [AXObserverCreateWithInfoCallback(_:_:_:)](applicationservices/1460610-axobservercreatewithinfocallback.md)
- [AXObserverGetRunLoopSource(_:)](applicationservices/1459139-axobservergetrunloopsource.md)
- [AXObserverGetTypeID()](applicationservices/1461244-axobservergettypeid.md)
- [AXObserverRemoveNotification(_:_:_:)](applicationservices/1462066-axobserverremovenotification.md)
