1.增加继承类申明,在头文件中添加代码
UIViewController< UIWebViewDelegate>
2.定义类变量UIWebView *webView;
3.实现web页面的导入webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, width, height-10)];
[webView setDelegate:self];
NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://hcx.sjszt.com/m"]];
[self.view addSubview: webView];
[webView loadRequest:request];
4.添加默认方法- (void) webViewDidStartLoad:(UIWebView *)webView
{//开始导入页面
}- (void) webViewDidFinishLoad:(UIWebView *)webView
{//导入网页结束
}- (void) webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{//导入页面异常
}