According to my need I have to use 2 SearchBar and Search Display controller (Same as in google navigation 1. Source 2. Destination), So when I am using these 2 UISearchBar iOS is giving a single Display controller i.e self.searchDisplayController.
in the following method I have to make a web api call and before getting response from web server it is updating table showing no results :
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
Hence in - (void)connection:(NSURLConnection *)connection didReceiveData:
I am doing [self.searchDisplayController.searchResultsTableView reloadData];
For the 1st search bar it is working fine but for the 2nd SearchBar its only calling -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section and not calling - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath and hence 2nd seachbar's table is not updating.
Please help me in solving this and one more thing I observed that whichever Search and Display controller I draged first is working fine and 2nd one always giving this problem.
Aucun commentaire:
Enregistrer un commentaire