首先创建一个UIWebView,设置代理方法shouldStartLoadWithRequest,在该代理方法中即可获取跳转的url,每跳转一次都会执行该方法。
UIWebView * webView = [[UIWebView alloc] init];
webView.frame = CGRectMake(0, 0, FViewWidth, FViewHeight-50);
webView.delegate = self;
[self.view addSubview:webView];
webView.backgroundColor = [UIColor whiteColor];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:BeforeZhouBannerAPI]];
[webView loadRequest:request];
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
NSString * url = request.URL.absoluteString;
return YES;
}