NSArray *animals = [NSArra">

Find string in NSArray and return index of string - iOS Development

12 September 2012, 3:54 PM
Find a string in an NSArray
NSArray *animals = [NSArray arrayWithObjects:@"Dog", @"Mouse", @"Cat", nil];
NSLog(@"Index: %i", [animals indexOfObject:@"Cat"]);

This would provide the following 
Index: 2