tags:

views:

54

answers:

1

how to compare textfield string with array string in iphone sdk? please help me?

A: 
NSMutableArray *array=[[NSMutableArray alloc] initWithObjects:@"Apple",@"Google",@"AJS"];

NSString *tempString=textField.text;

for(int i=0; i<=[array count]; i++)
{
     if([tempString isEqualToString:[array objectAtIndex:i]])
     {
          NSLog("String is equal");
     }
}

this one will help you.

KingofHeaven