---
title: "init(options:capacity:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nshashtable/init(options:capacity:)"
---

# init(options:capacity:)

Returns a hash table initialized with the given attributes.

## Declaration

```swift
init(options: NSPointerFunctions.Options = [], capacity initialCapacity: Int)
```

## Parameters

- `options`: A bit field that specifies the options for the elements in the hash table. For possible values, see doc://com.apple.foundation/documentation/Foundation/NSHashTableOptions.
- `initialCapacity`: The initial number of elements the hash table can hold.

## Return Value

Return Value A hash table initialized with options specified by options and initial capacity of capacity.

## See Also

### Related Documentation

- [Collections Programming Topics](apple-archive/documentation/Cocoa/Conceptual/Collections.md)

### Initialization

- [init(pointerFunctions:capacity:)](foundation/nshashtable/init(pointerfunctions:capacity:).md)
