我在tableview中实现了搜索栏但是在搜索后我的地址从实际地址改变了,我现在应该怎么做
-(void)searchBar:(UISearchBar*)searchBar textDidChange:(NSString*)text
{
if(text.length == 0)
{
isFiltered = FALSE;
}
else
{
isFiltered = true;
filteredListResults = [[NSMutableArray alloc] init];
GWTG *gwtg ;
for (gwtg in listResults)
{
NSRange nameRange = [gwtg.celebrity_name rangeOfString:text options:NSCaseInsensitiveSearch];//NSCaseInsensitiveSearch
NSRange descriptionRange = [gwtg.location_name rangeOfString:text options:NSCaseInsensitiveSearch];
if(nameRange.location != NSNotFound || descriptionRange.location != NSNotFound)
{
[filteredListResults addObject:gwtg];
}
}
}
[tblSearch reloadData];
}