开发者

how to compare textfield string with array string in iphone sdk

开发者 https://www.devze.com 2023-01-05 04:52 出处:网络
how to compare textfield string with array string in iphone s开发者_开发问答dk? please help me?NSMutableArray *array=[[NSMutableArray alloc] initWithObjects:@\"Apple\",@\"Google\",@\"AJS\"];

how to compare textfield string with array string in iphone s开发者_开发问答dk? please help me?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消