iOS怎么获取并移除沙盒中Documents文件夹下的所有文件
1个回答
展开全部
NSString *pathOfDocument = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
BOOL ret = [manager isDeletableFileAtPath:pathOfDocument];
if (ret) {
NSError *error = nil;
[manager removeItemAtPath:pathOfDocument error:&error];
}
BOOL ret = [manager isDeletableFileAtPath:pathOfDocument];
if (ret) {
NSError *error = nil;
[manager removeItemAtPath:pathOfDocument error:&error];
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询