title: How to compare two NSURLs that are practically equivalent but have cosmetic string differences?
body: <p>Under IOS, I wish to identify pairs of <code>NSURL</code>s that are either identical or differ slightly but refer to the same destination. For instance <code>http://google.com</code> vs <code>http://google.com/</code>.</p>
  
  <p><code>isEquals</code> reports those NSURLs as diferent. Nor can I find a way to obtain a 'canonical' or 'normalized' form of an NSURL to compare those forms instead.</p>
  
  <pre><code>NSURL *a = [NSURL URLWithString:@"http://google.com"];
  NSURL *b = [NSURL URLWithString:@"http://google.com/"];
  
  if([a isEqual:b]) {
    NSLog(@"Same"); // Not run
  }
  
  if([[a absoluteURL] isEqual:[b absoluteURL]]) {
    NSLog(@"Same"); // Still not run
  }
  
  if([[a URLByStandardizingPath] isEqual:[b URLByStandardizingPath]]) {
    NSLog(@"Same"); // Still not run
  }
  </code></pre>
  
  <p>How can I compare two NSURLs while ignoring string differences that do not affect the intent of the URL?</p>