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

# CFURLCreateByResolvingBookmarkData(_:_:_:_:_:_:_:)

Returns a new URL made by resolving bookmark data.

```
func CFURLCreateByResolvingBookmarkData(_ allocator: CFAllocator!, _ bookmark: CFData!, _ options: CFURLBookmarkResolutionOptions, _ relativeToURL: CFURL!, _ resourcePropertiesToInclude: CFArray!, _ isStale: UnsafeMutablePointer<DarwinBoolean>!, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<CFURL>!
```

## Parameters

`allocator`

The allocator to use to allocate memory for the new `CFURL` object. Pass `NULL` or [`kCFAllocatorDefault`](/documentation/CoreFoundation/kCFAllocatorDefault) to use the current default allocator.

`bookmark`

The bookmark data the URL is derived from.

`options`

Options taken into account when resolving the bookmark data.

    To resolve a security-scoped bookmark to support App Sandbox, you must include (by way of bitwise     `OR`     operators with any other options in this parameter) the [`cfurlBookmarkResolutionWithSecurityScope`](/documentation/CoreFoundation/CFURLBookmarkResolutionOptions/cfurlBookmarkResolutionWithSecurityScope)     option.

`relativeToURL`

The base URL that the bookmark data is relative to. Can be `NULL`.

    If you are resolving a security-scoped bookmark to obtain a security-scoped URL, use this parameter as follows:

- To resolve an app-scoped bookmark, use a value of `nil`.
- To resolve a document-scoped bookmark, use the *absolute* path (despite this parameter’s name) to the document from which you retrieved the bookmark.

`resourcePropertiesToInclude`

An array of resource properties to include when creating the URL. Can be `NULL`.

`isStale`

If <doc://com.apple.documentation/documentation/Swift/true>, the bookmark data is stale.

`error`

The error that occurred in the case that the URL cannot be created.

## Return Value

A new URL made by resolving `bookmark`, or `NULL` if an error occurs.

## Discussion

To obtain a security-scoped URL from a security-scoped bookmark, call this method using the [`cfurlBookmarkResolutionWithSecurityScope`](/documentation/CoreFoundation/CFURLBookmarkResolutionOptions/cfurlBookmarkResolutionWithSecurityScope) option. In addition, to use security scope, you must first have enabled the appropriate entitlements for your app, as described in [Enabling Security-Scoped Bookmark and URL Access](https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW18).

To then obtain access to the file-system resource pointed to by a security-scoped URL (in other words, to bring the resource into your app’s sandbox), call the [`CFURLStartAccessingSecurityScopedResource(_:)`](/documentation/CoreFoundation/CFURLStartAccessingSecurityScopedResource(_:)) function (or its Cocoa equivalent) on the URL.

For an app-scoped bookmark, no sandboxed app other than the one that created the bookmark can obtain access to the file-system resource that the URL (obtained from the bookmark) points to.

For a document-scoped bookmark, any sandboxed app that has access to the bookmark data itself, and has access to the document that owns the bookmark, can obtain access to the resource.

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

## See Also

[`CFURLCreateBookmarkData`](/documentation/CoreFoundation/CFURLCreateBookmarkData(_:_:_:_:_:_:))

Returns bookmark data for a URL, created with specified options and resource values.



---

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)