<!--
{
  "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/NSManagedObjectID/uriRepresentation()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSManagedObjectID(im)URIRepresentation"
  },
  "title" : "uriRepresentation()"
}
-->

# uriRepresentation()

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

```
func uriRepresentation() -> URL
```

## Return Value

An `NSURL` object containing a URI that provides an archiveable reference to the object which the receiver represents.

## Discussion

If the corresponding managed object has not yet been saved, the object ID (and hence URI) is a temporary value that will change when the corresponding managed object is saved.

## See Also

[`managedObjectID(forURIRepresentation:)`](/documentation/CoreData/NSPersistentStoreCoordinator/managedObjectID(forURIRepresentation:))

Returns the object identifier for the specified URI representation.

[`object(with:)`](/documentation/CoreData/NSManagedObjectContext/object(with:))

Returns either an existing object from the context or a fault that represents that object.



---

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)