If I downloaded files in NSCachesDirectory programmatically in my app, is it also possible to delete the files programmatically?
I think this snippet should work for you:
NSFileManager *fileMgr = [NSFileManager defaultManager];
NSArray *fileArray = [fileMgr contentsOfDirectoryAtPath:directory error:nil];
for (NSString *filename in fileArray) {
[fileMgr removeItemAtPath:[directory stringByAppendingPathComponent:filename] error:NULL];
}