<!--
{
  "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/member(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSHashTable(im)member:"
  },
  "title" : "member(_:)"
}
-->

# member(_:)

Determines whether the hash table contains a given object, and returns that object if it is present

```
func member(_ object: ObjectType?) -> ObjectType?
```

## Parameters

`object`

The object to test for membership in the hash table.

## Return Value

If `object` is a member of the hash table, returns `object`, otherwise returns `nil`.

## Discussion

The equality test used depends on the personality option selected. For instance, choosing the [`objectPersonality`](/documentation/Foundation/NSPointerFunctions/Options/objectPersonality) option will use `isEqual:` to determine equality. See [`NSPointerFunctions.Options`](/documentation/Foundation/NSPointerFunctions/Options) for more information on personality options and their corresponding equality tests.

---

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)