On Mar 6, 2012, at 6:19 PM, Marco Tabini wrote:

> [array indexOfObject:object] should do the trick, though, if you need to do 
> it at every iteration, keeping a counter may be better.

Not if the array contains objects that are equal to one another. (It’s also a 
fairly expensive method, and the running time in this context will be O(n^2).)

-indexOfObjectIdenticalTo: is slightly better but won’t work if the array 
contains multiples of the same object.

Really it’s just much better all around to use a counter.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to