The question may be a duplicate. How do I change the "Cancel" lines? "No results" and "No results." in UISearchBar UISearchDisplayController?
Here is a modification of the answer:
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.001); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ for (UIView* v in self.sbc.searchResultsTableView.subviews) { if ([v isKindOfClass: [UILabel class]] && [[(UILabel*)v text] isEqualToString:@"No Results"]) {
Basically, what you are asking is just to access the UILabel, which displays the text "No results." There is no official way to do this. The workaround suggested on this page is to search for UILabel (by listing all subzones of the search results table) and change. I generally can’t encourage this kind of thing, but I find Apple’s refusal to provide an official way to deal with this “No Results” label in order to be completely unpleasant, so no tricks are allowed in this particular battle.
matt
source share