Hi All,
So I am trying to retrieve data from an XML stream coming from a URL. This URL is configured on a search string the user inputs. Is there any reason why this code should not be working?
NSString *searchString = "Geoff";
NSString *updatedURL = [NSString stringWithFormat:@"http://mysearchpage.com/searchQuery=%@", searchString];
NSLog(updatedURL);
NSURL *url = [[NSURL alloc] initWithString:updatedURL];
Now this works fine for single word searches, but as soon as I try and search for like a first and last name, the URL returns nil every time. Is there any behavior with the strings that may be causing that?
I have even tried to replace the " "'s with "%20"'s when the search string was appended to see if that was the problem. I did that using:
NSURL *url = [[NSURL alloc] initWithString:[updatedURL stringByReplacingOccurrencesOfString:@" " withString:@"%%20"]];
any ideas? Thanks in advance!