ios webView代理
pragmamark - WebView 代理方法
pragmamark 开始加载
-(void)webViewDidStartLoad:(UIWebView *)webView{
//显示网络请求加载[UIApplication sharedApplication].networkActivityIndicatorVisible=true;}
pragmamark 加载完毕
-(void)webViewDidFinishLoad:(UIWebView *)webView{
//隐藏网络请求加载图标[UIApplication sharedApplication].networkActivityIndicatorVisible=false;//设置按钮状态[self setBarButtonStatus];
}
pragmamark 加载失败
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
NSLog(@"error detail:%@",error.localizedDescription);
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"系统提示"message:@"网络连接发生错误!"delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
成功的三大原则:
1、坚持
2、不要脸
3、坚持不要脸