<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSHashTable/init(pointerFunctions:capacity:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSHashTable(im)initWithPointerFunctions:capacity:"
  },
  "title" : "init(pointerFunctions:capacity:)"
}
-->

# init(pointerFunctions:capacity:)

Returns a hash table initialized with the given functions and capacity.

```
init(pointerFunctions functions: NSPointerFunctions, capacity initialCapacity: Int)
```

## Parameters

`functions`

The pointer functions for the new hash table.

`initialCapacity`

The initial capacity of the hash table.

## Return Value

A hash table initialized with the given functions and capacity.

## Discussion

Hash tables allocate additional memory as needed, so `initialCapacity` simply establishes the object’s initial capacity.

---

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)