ios - webview won't load with string -
Viewdidload in my webview I am implementing the following code The problem is that when I include NSString * encodedString, the webview Will not be visible. I have a search string with spaces and sometimes. Any ideas about what's going on here?
NSString * urlString = [NSString stringWithFormat: @ "http://google.com?q=%@", search-string]; NSString * encodedString = CFBridgingRelease (CFURLCreateStringByAddingPercentEscapes (NULL, (CFStringRef) urlString, NULL, (CFStringRef) @ "! * '() :: @ and = + $, /?% # []", KCF string encodingTTF 8)); NSLog (@ "searchstressing% @", searchstress); NSURL * myURL = [NSURL URLWithString: EncodedString]; NSURLRequest * myRequest = [NSRR request request with url: myURL]; [Load webload load: myRequest]; What will happen to Google's first page results for this search string?
try it
NSString * urlString = [NSString stringWithFormat: @ "Http://www.google.com/search?q=%@", search-string]; UrlString = [URL string stringErdringPrint escapes using encoding: NSUFF 8 string encoding]; NSURL * myURL = [NSURL URLWithString: urlString]; NSURLRequest * myRequest = [NSRR request request with url: myURL]; [Load webload load: myRequest];
Comments
Post a Comment