标签:style class tar int string art set http com load 使用
//要实现UIWebViewDelegate代理
@interface TestViewController : UIViewController<UIWebViewDelegate>
{
UIWebView *protWebView;
}
@property (retain, nonatomic) IBOutletUIWebView *protWebView;
@implementation TestViewController
@synthesize protWebView;
- (void)viewDidLoad
{
NSLog(@"viewDidLoad");
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSURL *url = [[NSURL alloc]initWithString:@"http://www.baidu.com"];
[protWebViewloadRequest:[NSURLRequestrequestWithURL:url]];
}
//几个代理方法
- (void)webViewDidStartLoad:(UIWebView *)webView{
NSLog(@"webViewDidStartLoad");
}
- (void)webViewDidFinishLoad:(UIWebView *)web{
NSLog(@"webViewDidFinishLoad");
}
-(void)webView:(UIWebView*)webView DidFailLoadWithError:(NSError*)error{
NSLog(@"DidFailLoadWithError");
}
IOS-简单WebView的使用,布布扣,bubuko.com
标签:style class tar int string art set http com load 使用
原文地址:http://www.cnblogs.com/jhonyzhang/p/3700765.html