UISearchDisplayController UISearchBar(3)
if([strrangeOfString:searchText].location != NSNotFound )
{
[searchResult addObject:str];
}
}
self.searchData = [NSArrayarrayWithArray:searchResult];
[searchResult release];
}
-(BOOL)searchDisplayController:(UISearchDisplayController*)controller shouldReloadTableForSearchString:(NSString *)searchString {
[selffilterContentForSearchText:searchString
scope:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
return YES;
}
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption {
[selffilterContentForSearchText:[self.searchDisplayController.searchBar text] scope:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:searchOption]];
return YES;
}
//tableView cell刷新数据
-(UITableViewCell *) tableView:(UITableView *)tableViewcellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellName =@"cellName";
UITableViewCell *cell = [tableViewdequeueReusableCellWithIdentifier:cellName];
if(cell == nil)
相关新闻>>
- 发表评论
-
- 最新评论 更多>>