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

# NSCompareMapTables(_:_:)

Compares the elements of two map tables for equality.

```
func NSCompareMapTables(_ table1: NSMapTable<AnyObject, AnyObject>, _ table2: NSMapTable<AnyObject, AnyObject>) -> Bool
```

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the keys and corresponding values of `table1` and `table2` are the same, and the two tables are the same size, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## See Also

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

Creates a new map table in the specified zone.

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

Creates a new map table in the default zone.



---

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)