How to write UIWebView with default request address like (192.168.1.1)

I have implemented UIWebView in my application, but my default is "192.168.1.1" but it is not open by default and I tried using http://www.google.com "it works fine.

[iview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"192.168.1.1"]]];

      

it doesn't work and works with

[iview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];

      

+2


a source to share


4 answers


Place http://

in front of the ip address.



+2


a source


192.168.1.1 is not a valid URL. Have you tried http://192.168.1.1 ?



+1


a source


What do you want to open? Assuming you want to request something from a web server running on 192.168.1.1 ...

Part of the schema is missing. Check that [NSURL URLWithString: @ "192.168.1.1"] returns zero. You need to pass a string that complies with RFC2396

+1


a source


192.168.1.1 is the ip address, http://192.168.1.1 is the url. Please use a later version.

0


a source







All Articles