Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find the Array index value in objective c [duplicate]

Tags:

xcode

ios

iphone

Possible Duplicate:
Getting Index of an Object from NSArray?

I have one Array and one string. Array name is "Array1", String name is "String", Now i have this below Values in "Array1".

"array1 = [[NSMutableArray alloc]initWithObjects:@"A",@"b",@"c",@"d",@"e", nil];"

My String value is "A"

Now i want to compare these string and array. And i want to display the Array index value.

How can i do this. Please somebody help me. Thanks in advance.

like image 974
kannan Avatar asked Nov 28 '22 01:11

kannan


1 Answers

i'm not sure if this is what you're looking for but maybe:

int index = [array1 indexOfObject:String];
like image 118
Andrey Chernukha Avatar answered Dec 09 '22 14:12

Andrey Chernukha