<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFURLStopAccessingSecurityScopedResource(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFURLStopAccessingSecurityScopedResource"
  },
  "title" : "CFURLStopAccessingSecurityScopedResource(_:)"
}
-->

# CFURLStopAccessingSecurityScopedResource(_:)

In an app that adopts App Sandbox, revokes access to the resource pointed to by a security-scoped URL.

```
func CFURLStopAccessingSecurityScopedResource(_ url: CFURL!)
```

## Parameters

`url`

The security-scoped URL that points to the file-system resource you want to stop accessing.

## Discussion

When you no longer need access to a file or directory pointed to by a security-scoped URL, such as one returned by resolving a security-scoped bookmark, call this function (or its Cocoa equivalent, <doc://com.apple.documentation/documentation/Foundation/NSURL/stopAccessingSecurityScopedResource()>) on the URL.

> Warning:
> You must balance every call to the ``doc://com.apple.corefoundation/documentation/CoreFoundation/CFURLStartAccessingSecurityScopedResource(_:)`` method with a corresponding call to the ``doc://com.apple.corefoundation/documentation/CoreFoundation/CFURLStopAccessingSecurityScopedResource(_:)`` method. If you fail to relinquish your access when you no longer need a file-system resource, your app leaks kernel resources. If sufficient kernel resources are leaked, your app loses its ability to add file-system locations to its sandbox, such as via Powerbox or security-scoped bookmarks, until relaunched.

> Version note:
> Security-scoped bookmarks are not available in versions of macOS prior to OS X v10.7.3.

---

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)