- (void)searchBarTextDidBeginEditing:(UISearchBar *)hsearchBar
{
searchBar.showsCancelButton = YES;
for(id cc in [searchBar subviews])
{
if([cc isKindOfClass:[UIButton class]])
{
UIButton *btn = (UIButton *)cc;
[btn setTitle:@"取消" forState:UIControlStateNormal];
}
}
}
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.001);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
for (UIView* subview in telSearchDisplayController.searchResultsTableView.subviews) {
if ([subview isKindOfClass: [UILabel class]] &&
[[(UILabel*)subview text] isEqualToString:@"No Results"]) {
UILabel *lbl = (UILabel*)subview; // sv changed to subview.
lbl.text = @"没有结果";
break;
}
}
});