I've got two problem left with my app that I can't figure out. Looked through all of the documentation & can't seem to find the answer.
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];
}
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.
|
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 relating to either problem would be greatly appreciated