how to delete all files in a folder, but not the folder itself?
- by Frost Li
I try to delete all files including subdirectories in a folder:
NSFileManager *deleteMgr = [NSFileManager defaultManager];
NSString *path = @"~/test/";
[deleteMgr removeItemAtPath:path error:&error];
And it deletes everything including the folder itself.
But what I expect is an empty folder.
Could anyone please help me what did I do wrong?
Really thanks your help! :)