As of iOS 5 you can just use isEqual:
(see comments)
Try [indexPath1 compare: indexPath2] == NSOrderedSame
.
Maybe you found a bug in NSIndexPath
. If you try to create a new NSIndexPath
with a path that already exists you should get that one instead. So isEqual:
probably just compares the pointers and not the actual indices stored.