Skip to main content
added 7 characters in body
Source Link
Alex Rozanski
  • 38k
  • 10
  • 70
  • 69

You can use the indexOfObject: method from NSArray:

intNSUInteger index = [animalOptions indexOfObject:@"Bear"];

If there are duplicate entries then the lowest index of that object is returned. For more information, take a look at the docs.

You can use the indexOfObject: method from NSArray:

int index = [animalOptions indexOfObject:@"Bear"];

If there are duplicate entries then the lowest index of that object is returned. For more information, take a look at the docs.

You can use the indexOfObject: method from NSArray:

NSUInteger index = [animalOptions indexOfObject:@"Bear"];

If there are duplicate entries then the lowest index of that object is returned. For more information, take a look at the docs.

Source Link
Alex Rozanski
  • 38k
  • 10
  • 70
  • 69

You can use the indexOfObject: method from NSArray:

int index = [animalOptions indexOfObject:@"Bear"];

If there are duplicate entries then the lowest index of that object is returned. For more information, take a look at the docs.