---
title: "handleMachMessage(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmachportdelegate/handlemachmessage(_:)"
---

# handleMachMessage(_:)

Process an incoming Mach message.

## Declaration

```swift
optional func handleMachMessage(_ msg: UnsafeMutableRawPointer)
```

## Parameters

- `msg`: A pointer to a Mach message, cast as a pointer to void.

## Discussion

Discussion The delegate should interpret this data as a pointer to a Mach message beginning with a msg_header_t structure and should handle the message appropriately. The delegate should implement either handleMachMessage: or the PortDelegate protocol method handlePortMessage:.

## See Also

### Related Documentation

- [Distributed Objects Programming Topics](apple-archive/documentation/Cocoa/Conceptual/DistrObjects.md)
