---
title: "init(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsurl/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.

## Declaration

```swift
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

Return Value An NSURL initialized by resolving bookmarkData.

## Discussion

Discussion note: 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 in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Creating a URL object

- [init(string:)](foundation/nsurl/init(string:).md)
- [init(string:encodingInvalidCharacters:)](foundation/nsurl/init(string:encodinginvalidcharacters:).md)
- [init(string:relativeTo:)](foundation/nsurl/init(string:relativeto:).md)
- [fileURL(withPath:isDirectory:)](foundation/nsurl/fileurl(withpath:isdirectory:).md)
- [init(fileURLWithPath:isDirectory:)](foundation/nsurl/init(fileurlwithpath:isdirectory:).md)
- [fileURL(withPath:relativeTo:)](foundation/nsurl/fileurl(withpath:relativeto:).md)
- [init(fileURLWithPath:relativeTo:)](foundation/nsurl/init(fileurlwithpath:relativeto:).md)
- [fileURL(withPath:isDirectory:relativeTo:)](foundation/nsurl/fileurl(withpath:isdirectory:relativeto:).md)
- [init(fileURLWithPath:isDirectory:relativeTo:)](foundation/nsurl/init(fileurlwithpath:isdirectory:relativeto:).md)
- [fileURL(withPath:)](foundation/nsurl/fileurl(withpath:).md)
- [init(fileURLWithPath:)](foundation/nsurl/init(fileurlwithpath:).md)
- [fileURL(withPathComponents:)](foundation/nsurl/fileurl(withpathcomponents:).md)
- [init(resolvingAliasFileAt:options:)](foundation/nsurl/init(resolvingaliasfileat:options:).md)
- [fileURL(withFileSystemRepresentation:isDirectory:relativeTo:)](foundation/nsurl/fileurl(withfilesystemrepresentation:isdirectory:relativeto:).md)
- [getFileSystemRepresentation(_:maxLength:)](foundation/nsurl/getfilesystemrepresentation(_:maxlength:).md)
