I wish to change the title of the cancel button in iOS. I have been using this previously:
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayCon
It seems like "self.searchDisplayController.searchBar.subviews" just return the "searchBar" itself. I tried bellow, and it works!
for (UIView *searBarView in [self.searchDisplayController.searchBar subviews])
{
for (UIView *subView in [searBarView subviews])
{
if ([subView isKindOfClass:[UIButton class]])
{
UIButton *cancleButton = (UIButton *)subView;
[cancleButton setTitle:@"hi" forState:UIControlStateNormal];
}
}
}