<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/nsurl-isequal",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "isEqual:"
}
-->

# isEqual:

Returns a Boolean value that indicates whether the receiver and a given object have identical URL strings and base URLs.

## Discussion

This method defines what it means for instances to be equal. Two NSURLs are considered equal if and only if they return identical values for both [`baseURL`](/documentation/Foundation/NSURL/baseURL) and [`relativeString`](/documentation/Foundation/NSURL/relativeString).

---

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)