tags:

views:

36

answers:

0

Hello, i have got a Problem with Caching data. My last Post was closed, because i have made something wrong. (Dont know yet,..but does not matter)

I get Content with InitwithContentURL,and i receive this String every 10 Seconds, but often it loads something, which looks like "caching".

This is the function:

NSURL *xmlURL=[NSURL URLWithString:URL];
NSURLRequest *request = [NSURLRequest requestWithURL:xmlURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60];
NSURLResponse *theResponse;
NSError *theError;
NSData *myRequestResult = [[NSMutableData alloc] initWithLength:0];
[[NSURLCache sharedURLCache] removeAllCachedResponses];
[[NSURLCache sharedURLCache] setMemoryCapacity: 0];
[[NSURLCache sharedURLCache] setDiskCapacity:0];
NSURLCache *sharedCache = [NSURLCache sharedURLCache];
[sharedCache removeAllCachedResponses];
myRequestResult = [NSURLConnection sendSynchronousRequest:request returningResponse:&theResponse error:&theError  ];

[[NSURLCache sharedURLCache] removeAllCachedResponses];
    NSString *stringReply = (NSString *)[[NSString alloc] initWithData:myRequestResult encoding:NSUTF8StringEncoding];
NSLog(@"reply from server: %@", stringReply);

Kindly Regards,

Andreas