Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试通过 NSURLProtocol 将指定的网页缓存到磁盘,现在我只能获取第一个 URL 请求,但 UIWebView 会产生更多用于加载图形的 URL 请求。那么如何拦截 UIWebView 从第一个 URL 产生的所有请求呢?非常感谢!
实现委托方法
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
每次您的 webview 加载 url 时,它都会首先调用此方法。