Answer the question
In order to leave comments, you need to log in
How to programmatically clear the cache in (Sandbox/Library/Caches) in ios7?
This method works on the simulator, but does not work on the device:
- (void)cleunupCache
{
NSFileManager *fm = [NSFileManager defaultManager];
NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)[0];
NSLog(@"%@", cachePath);
if ([fm fileExistsAtPath: cachePath])
{
[fm removeItemAtPath:cachePath error:nil];
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question