ios Web客户端开发(1)
开发前可以在自己电脑上提供一个web服务
在System preference中点击share,然后选中web sharing;
mac就会利用内置的apach自动提供一个web服务;
在程序中创建一个Url:
NSURL *myUrl = [[NSURLalloc]initWithString:@"http://127.0.0.1/~an/test.html"];
利用url创建一个url请求:
NSURLRequest *myReguest = [[NSURLRequest alloc]initWithURL:myUrl];
调用webView的loadRequest方法,便可以把Html页面下载下来:
[myWebView loadRequest:myReguest];
浙公网安备 33010602011771号