<!--
{
  "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/NSAllHashTableObjects(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@F@NSAllHashTableObjects"
  },
  "title" : "NSAllHashTableObjects(_:)"
}
-->

# NSAllHashTableObjects(_:)

Returns all of the elements in the specified hash table.

```
func NSAllHashTableObjects(_ table: NSHashTable<AnyObject>) -> [Any]
```

## Return Value

An array object containing all the elements of `table`.

## Discussion

This function should be called only when the table elements are objects, not when they’re any other data type.

## See Also

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

Creates and returns a new hash table.

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

Deletes the specified hash table.



---

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)