Hi, I am working on an application and part of it is to let the user type something in a text field and search it via google. Right now I have it linked to google and when the user presses search its transitions to the webView. My problem is that I can't get xcode to take what the user has typed into the text field and insert it into the google link properly. Right now it just shows a search of "(null)" in the webView. I was wondering if anyone can help me resolve this. Oh by the way this is my first post and I don't know how to put code in properly so I will just copy and paste it.
Thanks in advance for future help!
Code:
NSLog(@"%@",searchBarGoogle.text);
NSString *string1 = [[NSString alloc] initWithFormat:@"%@",searchBarGoogle.text];
NSString *string = [NSString stringWithFormat:@"http://www.google.com/search?q=%@",string1];
NSURL *url = [NSURL URLWithString:string];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
Thanks in advance for future help!
Last edited by a moderator: