<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSManagedObject/objectID",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSManagedObject(py)objectID"
  },
  "title" : "objectID"
}
-->

# objectID

The object ID of the managed object.

```
var objectID: NSManagedObjectID { get }
```

## Discussion

If the receiver is a fault, accessing this property does not cause it to fire.

> Important:
> If the receiver has not yet been saved, the object ID is a temporary value that will change when the object is saved.

## See Also

[`-  URIRepresentation`](/documentation/CoreData/NSManagedObjectID/uriRepresentation())

Returns a URI that provides an archiveable reference to the object for the object ID.



---

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)