<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/PortMessage/msgid",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPortMessage(py)msgid"
  },
  "title" : "msgid"
}
-->

# msgid

Returns the identifier for the receiver.

```
var msgid: UInt32 { get set }
```

## Return Value

The identifier for the receiver.

## Discussion

Cooperating applications can use this to define different types of messages, such as connection requests, RPCs, errors, and so on.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)