---
title: "init(keyOptions:valueOptions:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsmaptable/init(keyoptions:valueoptions:)"
---

# init(keyOptions:valueOptions:)

Returns a new map table, initialized with the given options

## Declaration

```swift
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 doc://com.apple.foundation/documentation/Foundation/NSMapTableOptions.
- `valueOptions`: A bit field that specifies the options for the values in the map table. For possible values, see doc://com.apple.foundation/documentation/Foundation/NSMapTableOptions.

## Return Value

Return Value A new map table, initialized with the given options.

## See Also

### Creating and Initializing a Map Table

- [init(keyOptions:valueOptions:capacity:)](foundation/nsmaptable/init(keyoptions:valueoptions:capacity:).md)
- [init(keyPointerFunctions:valuePointerFunctions:capacity:)](foundation/nsmaptable/init(keypointerfunctions:valuepointerfunctions:capacity:).md)
- [strongToStrongObjects()](foundation/nsmaptable/strongtostrongobjects().md)
- [weakToStrongObjects()](foundation/nsmaptable/weaktostrongobjects().md)
- [strongToWeakObjects()](foundation/nsmaptable/strongtoweakobjects().md)
- [weakToWeakObjects()](foundation/nsmaptable/weaktoweakobjects().md)
- [NSMapTableOptions](foundation/nsmaptableoptions.md)
