- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText // called when text changes (including clear)
{
if (searchBar.text.length > IMPUT_MAX){
searchBar.text = [searchBar.text substringToIndex:15];
}
}
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText // called when text changes (including clear)
{
if (searchBar.text.length > IMPUT_MAX){
searchBar.text = [searchBar.text substringToIndex:15];
}
}
转载于:https://www.cnblogs.com/KiVen2015/p/5791455.html