---
title: "CFURLStartAccessingSecurityScopedResource(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfurlstartaccessingsecurityscopedresource(_:)"
---

# CFURLStartAccessingSecurityScopedResource(_:)

In an app that has adopted App Sandbox, makes the resource pointed to by a security-scoped URL available to the app.

## Declaration

```swift
func CFURLStartAccessingSecurityScopedResource(_ url: CFURL!) -> Bool
```

## Parameters

- `url`: The security-scoped URL that points to the file-system resource you want to access.

## Return Value

Return Value true if the request to access the resource succeeded; otherwise, false.

## Discussion

Discussion When you obtain a security-scoped URL, such as by resolving a security-scoped bookmark, you cannot immediately use the resource it points to. To make the resource available to your app, by way of adding its location to your app’s sandbox, call this function (or its Cocoa equivalent, startAccessingSecurityScopedResource()) on the security-scoped URL. Calls to the CFURLStartAccessingSecurityScopedResource(_:) function (or its Cocoa equivalent) are nestable on a per-process basis. This means that if your app calls the start method on a URL twice, to fully relinquish access to the referenced resource you must call the corresponding stop method twice. warning: You must balance every call to the CFURLStartAccessingSecurityScopedResource(_:) method with a corresponding call to the 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. note: Security-scoped bookmarks are not available in versions of macOS prior to OS X v10.7.3.

## See Also

### Working with Bookmark Data

- [CFURLCreateBookmarkData(_:_:_:_:_:_:)](corefoundation/cfurlcreatebookmarkdata(_:_:_:_:_:_:).md)
- [CFURLCreateBookmarkDataFromAliasRecord(_:_:)](corefoundation/cfurlcreatebookmarkdatafromaliasrecord(_:_:).md)
- [CFURLCreateBookmarkDataFromFile(_:_:_:)](corefoundation/cfurlcreatebookmarkdatafromfile(_:_:_:).md)
- [CFURLWriteBookmarkDataToFile(_:_:_:_:)](corefoundation/cfurlwritebookmarkdatatofile(_:_:_:_:).md)
- [CFURLStopAccessingSecurityScopedResource(_:)](corefoundation/cfurlstopaccessingsecurityscopedresource(_:).md)
