Re: Intercepting spawned URL requests from UIWebView and caching the response
Re: Intercepting spawned URL requests from UIWebView and caching the response
- Subject: Re: Intercepting spawned URL requests from UIWebView and caching the response
- From: BareFeetWare <email@hidden>
- Date: Thu, 21 Jun 2012 09:20:57 +1000
On 20/06/2012, at 5:42 PM, 尹佳冀 <email@hidden> wrote:
>> The UIWebView sees the nil return (ie nothing cached) and so proceeds to load the URL itself. So now I have two processes loading the same URL: The web view and the custom caching mechanism
> In this case you return a fake data, like <pre>fakeData = [[NSData dataWithBytes:" " length:1] retain];</pre>, webview will no to load this url, does this solution can help you?
Thanks for your answer.
True, if I feed empty data (ie not a nil) back to the web view from the cache request, the web view won't continue to load the URL. However, unless I can then ask the web view to instead load the cached version (after it downloads), I just get a blank web page. Since the URL also spawns other URL requests (eg images, javascript, CSS, redirects), they won't be loaded at all unless the web view loads the parent resource.
Any other ideas?
Thanks,
Tom
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden