Consider the following statement:
for (NSString *string in anArray) {
NSLog(@"%@", string);
}
How can I get the index of string
in anArray
without using a traditional for
loop and without checking the value of string
with every object in anArray
?