UIWebView* webPage=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight-64)];
NSURL* url=[[NSURL alloc]initWithString:@"http://www.baidu.com"];
NSURLRequest* request=[[NSURLRequest alloc]initWithURL:url];
[webPage loadRequest:request];
webPage.scalesPageToFit=YES;
webPage.delegate=self;
[self.view addSubview:webPage];
<UIWebViewDelegate>中方法
- (void)webViewDidStartLoad:(UIWebView *)webView; //网页开始加载时候执行的方法
- (void)webViewDidFinishLoad:(UIWebView *)webView; //网页结束加载时候执行的方法
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error; //网页加载失败时候执行的方法
Xcode7.0以后需要在Info.plist中加入以下属性 才能正确加载网页
注意NSAllows为App的子项