title: How to Use Cache Memory concept in objective-c
body: <p>//  Web service request</p>
  
  <pre><code>        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: urlLoc]];
          NSString *postLength = [NSString stringWithFormat:@"%d", [requestData length]];
          [request setHTTPMethod: @"POST"];
          [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
          [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
          [request setHTTPBody: requestData];
  
          NSError *respError = nil;
          NSData *returnData = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: &amp;respError ];
  
    //returndata is response of webservice
   NSString *responseString = [[NSString alloc] initWithData:returnData encoding: NSUTF8StringEncoding];
  
  
          NSDictionary *results = [responseString JSONValue] ;
          NSLog(@"chat data- %@",results);
  
          NSString *strResults = [results objectForKey:@"d"];
          NSLog(@"result string is-%@",strResults);
  </code></pre>
  
  <p>this is the code that I am using for my Data fetching from web service. But i have  to do this every time when come to this page.
  Is that any method that can store my data in Cache memory so i need not to request every time.</p>
  
  <p>I Am using </p>
  
  <p>NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];</p>
  
  <p>but i dont know how to use - (NSCachedURLResponse *) connection this method
  thanks...</p>