Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get index of an item in an array

I am having array called stored and I want to access their indexes so that I can select them individually to do my operations.

If I want to print their indexes, what should I do?

like image 583
Linux world Avatar asked Aug 13 '10 15:08

Linux world


1 Answers

use NSArray's indexOfObject: method. Such as the following:

NSUInteger fooIndex = [someArray indexOfObject: someObject];
like image 177
jer Avatar answered Oct 10 '22 09:10

jer