如何删除我的应用程序的NSDocumentsDirectory下的所有文件?
我试过用
NSString *DocumentsDirectoryPath = //Code to fetch the Documents Directory Path;
NSError *error;
NSFileManager *manager = [NSFileManager defaultManager];
[manager removeItemAtPath:DocumentsDirectoryPath error:&error];
上面的代码删除了我的应用程序的整个Documents目录,但我只想删除Documents目录的内容而不是Documents目录本身。
我该怎么办?
没有找到相关结果
已邀请:
1 个回复
闲窍
请参阅此链接以获得答案: 如何删除Documents目录的内容(而不是Documents目录本身)? 希望这能帮助所有寻求解决方案的人:)