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 pr
As of iOS 5 you can just use isEqual:
(see comments)
[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.