---
title: "removeObject(forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmaptable/removeobject(forkey:)"
---

# removeObject(forKey:)

Removes a given key and its associated value from the map table.

## Declaration

```swift
func removeObject(forKey aKey: KeyType?)
```

## Parameters

- `aKey`: The key to remove.

## Discussion

Discussion Does nothing if aKey does not exist.

## See Also

### Manipulating Content

- [setObject(_:forKey:)](foundation/nsmaptable/setobject(_:forkey:).md)
- [removeAllObjects()](foundation/nsmaptable/removeallobjects().md)
