Wednesday, May 1, 2013

NSURLRequest NSURLRequestReloadIgnoringCacheData example ios


enum
{
   NSURLRequestUseProtocolCachePolicy = 0,
   NSURLRequestReloadIgnoringLocalCacheData = 1,
   NSURLRequestReloadIgnoringLocalAndRemoteCacheData =4,
   NSURLRequestReloadIgnoringCacheData = NSURLRequestReloadIgnoringLocalCacheData,
   NSURLRequestReturnCacheDataElseLoad = 2,
   NSURLRequestReturnCacheDataDontLoad = 3,
   NSURLRequestReloadRevalidatingCacheData = 5
};
typedef NSUInteger NSURLRequestCachePolicy;
NSURLRequestReloadIgnoringCacheData
Example of [NSURLRequest NSURLRequestReloadIgnoringCacheData]
NSString *urlString = [NSString stringWithFormat:@"http://test.localhost/api/request.php?url=%@", passedValue]; 
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy: NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
Example of [NSURLRequest NSURLRequestReloadIgnoringCacheData]
NSURLRequest *lRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:link] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:20.0];