1) Can't search more than 1 word queries. Here's the code that I have for searching a site
CODE
- (void)searchBarTextDidEndEditing:(UISearchBar *)mySearchBar
{
//•• start your search!
UIApplication *app = [UIApplication sharedApplication];
NSString *nameString = self.mySearchBar.text;
NSString *urlString = [NSString stringWithFormat:@"Site that I am searching", nameString];
NSURL *url = [NSURL URLWithString:urlString];
[app openURL:url];
}
{
//•• start your search!
UIApplication *app = [UIApplication sharedApplication];
NSString *nameString = self.mySearchBar.text;
NSString *urlString = [NSString stringWithFormat:@"Site that I am searching", nameString];
NSURL *url = [NSURL URLWithString:urlString];
[app openURL:url];
}
When I emailed Apple's Dev Tech Support, they said
QUOTE
I think you might need to precent-escape all spaces when constructing the URL for searching (%20) should be replaced by the space. There are APIs in NSURL
and NSString that help you do this.
and NSString that help you do this.
I looked all through any documentation relating to NSURL & NSString & couldn't find anything related to that.
2) And when I do have a valid query entered, any other buttons on the app, like a button to the "About" page, initializes the search process.
Apple Dev Tech Support suggested this
QUOTE
Set some break points in your code and find out who is starting the search.
How exactly would I do that? Any help related to either problem would be greatly appreciated