views:

204

answers:

1

I have a question concerning the caching of webcontent.

I've created a UIWebview component

Code:

NSString *urlAddress = @"http://192.168.55.101/~test/mobile/iphone/ads/v0.1/";

  //URL OBJECT footer
  UIWebView *aWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320 , 100)];
  NSURL *url = [NSURL URLWithString:urlAddress];
  NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
  [aWebView loadRequest:requestObj];

This shows a picture in my iPhone. I've tried looking into cache attributes and functions (for instance NSURLRequestReturnCacheDataElseLoad ) to see which options I have , but what's the best way to cache the image appearing in this screen.

Or how do I use NSURLRequestReturnCacheDataElseLoad?

+1  A: 

There is a good sample code: Apple sample code

Description:

CacheInfo allows you to choose a URL, create a connection, load the resource asynchronously, and observe results such as the data size, load time, and cache usage. You can adjust the sizes of the shared memory and disk caches and observe how caching is affected during the load.

Ghommey
thank you, I'm going to look into it.
jovany