开发者

How to implement type ahead functionality for UIsearchbar in ipad

开发者 https://www.devze.com 2023-03-08 04:18 出处:网络
I have to implement 开发者_高级运维the type ahead functionality for a search bar in ipad. whether such functionality is by default provided by any search bar delegate or how to implement it??As I know

I have to implement 开发者_高级运维the type ahead functionality for a search bar in ipad. whether such functionality is by default provided by any search bar delegate or how to implement it??


As I know this functionality is not provided by default, and you should do it by yourself. If you use tableView to display search results you should override searchBar:textDidChange: method of UISearchBar delegate. Something like this:

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
    [self setSearchString:searchText];
    [self.searchResultsTable reloadData];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消