<!--
{
  "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/NSMapTable/init(keyOptions:valueOptions:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMapTable(cm)mapTableWithKeyOptions:valueOptions:"
  },
  "title" : "init(keyOptions:valueOptions:)"
}
-->

# init(keyOptions:valueOptions:)

Returns a new map table, initialized with the given options

```
init(keyOptions: NSPointerFunctions.Options = [], valueOptions: NSPointerFunctions.Options = [])
```

## Parameters

`keyOptions`

A bit field that specifies the options for the keys in the map table. For possible values, see [`NSMapTableOptions`](/documentation/Foundation/NSMapTableOptions).

`valueOptions`

A bit field that specifies the options for the values in the map table. For possible values, see [`NSMapTableOptions`](/documentation/Foundation/NSMapTableOptions).

## Return Value

A new map table, initialized with the given options.

## Discussion

---

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)