I\'m working on an app that uses the iPhone camera and after making several tests I\'ve realised that it is storing all the captured videos on the tmp directory of the app.
This works on a jailbroken iPad, but I think this should work on a non-jailbroken device also.
-(void) clearCache
{
for(int i=0; i< 100;i++)
{
NSLog(@"warning CLEAR CACHE--------");
}
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError * error;
NSArray * cacheFiles = [fileManager contentsOfDirectoryAtPath:NSTemporaryDirectory() error:&error];
for(NSString * file in cacheFiles)
{
error=nil;
NSString * filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:file ];
NSLog(@"filePath to remove = %@",filePath);
BOOL removed =[fileManager removeItemAtPath:filePath error:&error];
if(removed ==NO)
{
NSLog(@"removed ==NO");
}
if(error)
{
NSLog(@"%@", [error description]);
}
}
}