UIWebView * webView = [[UIWebView alloc] initWithFrame:self.view.frame];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.baidu.com"]]];
webView.delegate = self;//设置代理
[self.view addSubview:webView];
//webview 方法
// [webView goBack]; //返回
// [webView goForward]; //前进
// [webView reload]; //刷新
// [webView stopLoading]; //停止
}
-(void)webViewDidStartLoad:(UIWebView *)webView
{
NSLog(@"start load>>>>>>");
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
NSLog(@"finish load>>>>>");
}
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
NSLog(@"error>>>>%@",error);
}