---
title: "init(resolvingAliasFileAt:options:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsurl/init(resolvingaliasfileat:options:)"
---

# init(resolvingAliasFileAt:options:)

Returns a new URL made by resolving the alias file at url.

## Declaration

```swift
convenience init(resolvingAliasFileAt url: URL, options: NSURL.BookmarkResolutionOptions = []) throws
```

## Parameters

- `url`: The URL pointing to the alias file.
- `options`: Options taken into account when resolving the bookmark data. The doc://com.apple.foundation/documentation/Foundation/NSURL/BookmarkResolutionOptions/withSecurityScope option is not supported by this method.

## Return Value

Return Value A new URL created by resolving the bookmark data derived from the provided alias file. If an error occurs, this method returns nil.

## Discussion

Discussion Creates and initializes a new URL based on the alias file at url. Use this method to resolve bookmark data that was saved using writeBookmarkData(_:to:options:) and resolves that data in one step. If the url argument does not refer to an alias file as defined by the NSURLIsAliasFileKey property, this method returns the url argument. If the url argument is unreachable, this method returns nil and the optional error argument is populated. 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(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:)](foundation/nsurl/init(resolvingbookmarkdata:options:relativeto:bookmarkdataisstale:).md)
- [fileURL(withFileSystemRepresentation:isDirectory:relativeTo:)](foundation/nsurl/fileurl(withfilesystemrepresentation:isdirectory:relativeto:).md)
- [getFileSystemRepresentation(_:maxLength:)](foundation/nsurl/getfilesystemrepresentation(_:maxlength:).md)
