I have implemented a UITableView with search bar (and search display) - all works fine, but the table results do not get updated until the search bar cancel button is tapped.
Delegate methods:
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
// asynchronous request with [self.tableView reloadData] in the connectionDidFinishLoading
[self getProductData:searchBar.text];
[searchBar resignFirstResponder];
[self.tableView reloadData];
}
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
}
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {
}
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar {
}
- (BOOL)searchBarShouldEndEditing:(UISearchBar *)searchBar {
return YES;
}
Do I need to call a delegate method after receiving the data from the server? Or should I make the request synchronous?
Thanks
edit: I tried with a synchronous request and it still does not work!