Let’s say Items is a NSMutableArray. I want to know the index of the item object in its Items array. I can accomplish this by putting a counter “i” but that’s ugly. Is there an elegant way of doing this?
for(item* item in Items){
//do something with the item considering its **index** in the Items array
}
indexOfObject:
indexOfObjectIdenticalTo:
Edit:
Read carefully the descriptions, indexOfObjectIdenticalTo: is probably what you want in your case.
However, adding a counter is the fast way in this case.