开发者

how to compare textfield string with array string in iphone sdk

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜