Skip to content

Instantly share code, notes, and snippets.

@Jberlinsky
Created February 27, 2010 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jberlinsky/316354 to your computer and use it in GitHub Desktop.
Save Jberlinsky/316354 to your computer and use it in GitHub Desktop.
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
[searchBar resignFirstResponder];
NSLog(@"Search Text: %@",[searchBar text]);
[self startSearchingWithText:[searchBar text]];
}
- (void) startSearchingWithText:(NSString *)text {
...
// Go through the list of services and set up a query for the search term
QueryServiceManager *manager = [[QueryServiceManager alloc] initWithServices: services];
// Set up the query
if (![manager addKeyword: text])
NSLog(@"PROBLEM!");
// Execute the query and store the titles in an array
self.data = [[manager makeQuery] copy]; // Returns a NSArray
NSLog(@"%@",self.data);
// Add the items to the tableView
[self.tableView reloadData];
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment