title: isEqual doesn't always work for NSIndexPath? What can I use in its place?
body: <p>I've got some code that relies on comparing two NSIndexPaths and executing different code based on their equality or lack thereof (using -isEqual). Most of the time it works properly, but sometimes it doesn't. I've used the debugger console to test the two indexpaths during code execution, and they look identical to me.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>- (BOOL)selectedStreetIsSameAsLastSelectedStreet
  {
      return [self.indexPathOfSelectedStreet isEqual:self.previousObject.indexPathOfSelectedStreet];
  }
  </code></pre>
  
  <p>Here's the output during the execution of the code:</p>
  
  <pre><code>(gdb) po self.indexPathOfSelectedStreet
  &lt;NSIndexPath 0x60a0770&gt; 2 indexes [26, 1]
  (gdb) po self.previousObject.indexPathOfSelectedStreet
  &lt;NSIndexPath 0x55b4f70&gt; 2 indexes [26, 1]
  (gdb) p (BOOL)[self.indexPathOfSelectedStreet isEqual:self.previousObject.indexPathOfSelectedStreet]
  $2 = 0 '\000'
  </code></pre>
  
  <p>Am I doing something wrong, or is there another way I can reliably test the equality of two NSIndexPaths?</p>