<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSHashRemove(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@F@NSHashRemove"
  },
  "title" : "NSHashRemove(_:_:)"
}
-->

# NSHashRemove(_:_:)

Removes an element from the specified hash table.

```
func NSHashRemove(_ table: NSHashTable<AnyObject>, _ pointer: UnsafeRawPointer?)
```

## Discussion

If `pointer` matches an item already in `table`, this function releases the preexisting item.

## See Also

[`NSHashInsertKnownAbsent(_:_:)`](/documentation/Foundation/NSHashInsertKnownAbsent(_:_:))

Adds an element to the specified hash table.

[`NSHashInsert(_:_:)`](/documentation/Foundation/NSHashInsert(_:_:))

Adds an element to the specified hash table.

[`NSHashInsertIfAbsent(_:_:)`](/documentation/Foundation/NSHashInsertIfAbsent(_:_:))

Adds an element to the specified hash table only if the table does not already contain the element.



---

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)