I found the code below to delete file in objective-c, but I want to only delete all files under directory of Caches
and keep the directory Caches
itsel
Loop through the files in that directory.
NSFileManager *fileMgr = [NSFileManager defaultManager];
NSArray *fileArray = [fileMgr contentsOfDirectoryAtPath:directory error:nil];
for (NSString *filename in fileArray) {
[fileMgr removeItemAtPath:[directory stringByAppendingPathComponent:filename] error:NULL];
}