search substring from mutable array in iphone
- by user566431
how to search substring from mutable array?
NSMutableArrray names having string values,
searchText is a substring to search from name array values.
for (NSString *sTemp in names)
{
NSRange titleResultsRange = [sTemp rangeOfString:searchText options:NSCaseInsensitiveSearch];
//NSLog(@"sTemp = %@, searchText = %@",sTemp,searchText);
NSLog(@"%@",titleResultsRange.length);
if (titleResultsRange.length > 0)
[Items addObject:sTemp];
}