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];

posted on 2012-02-20 14:17  bingwenst  阅读(197)  评论(0)    收藏  举报

导航