---
title: "NSCopyHashTableWithZone(_:_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nscopyhashtablewithzone(_:_:)"
---

# NSCopyHashTableWithZone(_:_:)

Performs a shallow copy of the specified hash table.

## Declaration

```swift
func NSCopyHashTableWithZone(_ table: NSHashTable<AnyObject>, _ zone: NSZone?) -> NSHashTable<AnyObject>
```

## Return Value

Return Value A pointer to a new copy of table, created in zone and containing pointers to the data elements of table.

## Discussion

Discussion If zone is NULL, the new table is created in the default zone. The new table adopts the callback functions of table and calls the hash and retain callback functions as appropriate when inserting elements into the new table.

## See Also

### Related Documentation

- [NSCreateHashTableWithZone(_:_:_:)](foundation/nscreatehashtablewithzone(_:_:_:).md)
- [NSCreateHashTable(_:_:)](foundation/nscreatehashtable(_:_:).md)
- [NSHashTableCallBacks](foundation/nshashtablecallbacks.md)

### Functions

- [NSAllHashTableObjects(_:)](foundation/nsallhashtableobjects(_:).md)
- [NSCompareHashTables(_:_:)](foundation/nscomparehashtables(_:_:).md)
- [NSCountHashTable(_:)](foundation/nscounthashtable(_:).md)
- [NSCreateHashTable(_:_:)](foundation/nscreatehashtable(_:_:).md)
- [NSCreateHashTableWithZone(_:_:_:)](foundation/nscreatehashtablewithzone(_:_:_:).md)
- [NSEndHashTableEnumeration(_:)](foundation/nsendhashtableenumeration(_:).md)
- [NSEnumerateHashTable(_:)](foundation/nsenumeratehashtable(_:).md)
- [NSFreeHashTable(_:)](foundation/nsfreehashtable(_:).md)
- [NSHashGet(_:_:)](foundation/nshashget(_:_:).md)
- [NSHashInsert(_:_:)](foundation/nshashinsert(_:_:).md)
- [NSHashInsertIfAbsent(_:_:)](foundation/nshashinsertifabsent(_:_:).md)
- [NSHashInsertKnownAbsent(_:_:)](foundation/nshashinsertknownabsent(_:_:).md)
- [NSHashRemove(_:_:)](foundation/nshashremove(_:_:).md)
- [NSNextHashEnumeratorItem(_:)](foundation/nsnexthashenumeratoritem(_:).md)
- [NSResetHashTable(_:)](foundation/nsresethashtable(_:).md)
