URL Cache iphone
I have a开发者_Go百科 webView and I use [NSURLRequest requestWithURL:] to load the page. But since this increases the dependency on the network I am trying to cache the page such that the webView loads only once in a day. I tried using NSURLequest requestWithURL: cachePolicy: timeoutInterval: but this did not work. The example provided by apple "URLCache" is for images. How can i reduce the dependency on the network?
Thanks, Praveen
You could store the HTML from your request either in sqlite locally or on the file system for the initial daily request. Subsequent requests and just pull the HTML from the local store.
This is the delegate that gets the HTML (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
精彩评论