怎样识别最后一次调用webViewDidFinishLoad

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    NSLog(@"webViewDidStartLoad");
    webViewLoads_++;

}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    NSLog(@"webViewDidFinishLoad");
    // Disable user selection
//    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
    // Disable callout
//    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
    webViewLoads_--;
    
    if (webViewLoads_ > 0) {
        return;
    }
    
    // 最后一个
    
    
}

- (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error {
    webViewLoads_--;
}

猜你喜欢

转载自quding0308.iteye.com/blog/2111736