<!--
{
  "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" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURL/init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURL(im)initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:"
  },
  "title" : "init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)"
}
-->

# init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)

Initializes a newly created NSURL that points to a location specified by resolving bookmark data.

```
convenience init(resolvingBookmarkData bookmarkData: Data, options: NSURL.BookmarkResolutionOptions = [], relativeTo relativeURL: URL?, bookmarkDataIsStale isStale: UnsafeMutablePointer<ObjCBool>?) throws
```

## Parameters

`bookmarkData`

The bookmark data the URL is derived from.

`options`

Options taken into account when resolving the bookmark data.

`relativeURL`

The base URL that the bookmark data is relative to.

`isStale`

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

## Return Value

An NSURL initialized by resolving `bookmarkData`.

## Discussion

> Handling Errors in Swift:
> In Swift, this method returns a nonoptional result and is marked with the `throws` keyword to indicate that it throws an error in cases of failure.
> 
> You call this method in a `try` expression and handle any errors in the `catch` clauses of a `do` statement, as described in [Error Handling](https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html) in [The Swift Programming Language](https://docs.swift.org/swift-book/) and `About Imported Cocoa Error Parameters`.

---

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)