UIWebView webpage caching for offline viewing

前端 未结 2 1965
北海茫月
北海茫月 2020-12-01 04:40

First of all, I\'m pretty sure that I have checked every answer here and nothing does what I would like to do.

  1. In this question, for answer is given ASIHTTPRe
2条回答
  •  失恋的感觉
    2020-12-01 05:23

    NSString *stringurl=[NSString stringWithFormat:@"http://www.google.com"];
    NSURL *url=[NSURL URLWithString:stringurl];
    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:15.0];
    [uiwebview loadRequest:theRequest];
    

    The URL loading system provides a composite on-disk and in-memory cache of responses to requests. This cache allows an application to reduce its dependency on a network connection and increase its performance.

提交回复
热议问题