views:

114

answers:

2

What is the difference between these two NSArray methods?

+5  A: 

indexOfObjectIdenticalTo checks for the exact same id (same address). indexOfObject checks that isEqual returns YES.

Matthew Flaschen
+3  A: 

The first uses isEqual: to find a matching object, while the second looks for the same object (i.e., the object at the same memory location).

Marcelo Cantos