Is there an easy way to delete all the files(images) I saved in the documents folder of the app?
It may not be applicable in all cases but generally it would be more efficient to put all the files in a custom directory inside Documents Directory and then use removeItemAtPath:error:
to delete that directory and create it again. E.g.:
// Clear cache
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath:cacheDirectory error:&error];
if (error)
{
// error handling
}
// Create cache directory again
NSError *error2;
[[NSFileManager defaultManager] createDirectoryAtPath:cacheDirectory withIntermediateDirectories:YES attributes:nil error:&error2];
if (error2)
{
// error handling
}