Skip to content

Commit

Permalink
refresh table data after search end
Browse files Browse the repository at this point in the history
  • Loading branch information
prabirshrestha committed Feb 20, 2013
1 parent ebb5f61 commit f39947c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ - (void) setupTableView {

self.tableView.dataSource = self.tableView.dynamicDataSource;


// search bar
self.searchDisplayController.searchResultsDataSource = self.tableView.dynamicDataSource;
[self.searchBar.dynamicDelegate implementMethod:@selector(searchBarSearchButtonClicked:) withBlock:^void(UISearchBar* searchBar) {
[searchBar resignFirstResponder];
}];

[self.searchBar.dynamicDelegate implementMethod:@selector(searchBarCancelButtonClicked:) withBlock:^void(UISearchBar* searchBar) {
[self.displayDataSource removeAllObjects];
[self.displayDataSource addObjectsFromArray:self.dataSource];
[self.tableView reloadData];
[searchBar resignFirstResponder];
}];

Expand Down

0 comments on commit f39947c

Please sign in to comment.