<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.9.0 - 10.15.0"
  ],
  "documentType" : "symbol",
  "framework" : "MediaLibrary",
  "identifier" : "/documentation/MediaLibrary/MLMediaObject/url",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Media Library"
    ],
    "preciseIdentifier" : "c:objc(cs)MLMediaObject(py)URL"
  },
  "title" : "url"
}
-->

# url

The location of the media object.

```
var url: URL? { get }
```

## Discussion

This property is provided as a security-scoped URL. In order to gain access to the file that this URL refers to, the caller must call <doc://com.apple.documentation/documentation/Foundation/NSURL/startAccessingSecurityScopedResource()> before and <doc://com.apple.documentation/documentation/Foundation/NSURL/stopAccessingSecurityScopedResource()> after using the URL to access the file. For more information about security-scoped URLs, see <doc://com.apple.documentation/documentation/Foundation/NSURL>.

---

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)