NSString *documentDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
documentDir= [documentDir stringByAppendingPathComponent:@"/ThemeList"];
BOOL s=[[NSFileManager defaultManager] removeItemAtPath:documentDir error:nil];这是一段我的删除代码。。删除应用下沙盒目录的自己新建的一个ThemeList文件夹。我现在遇到一个问题。。
就是说。如果我在这个文件夹下面再新建一个文件夹A。执行上面代码。是OK的。
ThemeList文件夹被删除。A也被删除。
如果我将变量documentDir=[documentDir stringByAppendingPathComponent:@"/ThemeList/A"];
这样也是可以单独删除掉文件夹A的
问题出现了。。如果我在A下面再创建一个文件夹B。
那么代码删除就失败。
而且无论我把目录改成A也好。B也罢。都是失败的直接从ThemeList删除也是失败了。。
求解!~