hi,
I have a large table of around 2500 entries. I am displaying it on tableview. however the search bar is too slow while doing dynamic search. ie I am filtering the table everytime the user puts in a character on search bar.
following is the code:
- (void)searchBar:(UISearchBar *)theSearchBar textDidChange:(NSString *)searchText {
if([searchText length] > 0) {
searching = YES;
letUserSelectRow = YES;
self.tableView.scrollEnabled = YES;
[self searchTableView];
} else {
searching = NO;
letUserSelectRow = NO;
self.tableView.scrollEnabled = NO;
[whereClause setString: @"%%"];
}
[self.tableView reloadData];
}
- (void) searchTableView {
NSString *searchText = searchBar.text;
[whereClause setString: @"%%"];
[whereClause appendString: searchText];
[whereClause appendString: @"%%"];
[self.tableView reloadData];
}
the whereClause is there in the sqlite query, so it keeps appending the search character. When the user types in the keyboard keys become quite sticky and slow to type. Any suggestion will be appreciated...