indexOfObject vs. indexOfObjectIdenticalTo

William Jockusch picture William Jockusch · Jul 2, 2010 · Viewed 10.5k times · Source

What is the difference between these two NSArray methods?

Answer

Matthew Flaschen picture Matthew Flaschen · Jul 2, 2010

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