objectivec文件、文件夹操作

objective-c文件、文件夹操作

1
2
3
4
5
6
7
8
9
//如果"/Documents/Theme"路径不存在,则创建。
if(![[NSFileManager defaultManager]fileExistsAtPath:themePath])
{
    [[NSFileManager defaultManager] createDirectoryAtPath:themePath attributes:nil];
}
//删除已存在的同名文件夹
if ([[NSFileManager defaultManager] fileExistsAtPath:savePath]) {
    [[NSFileManager defaultManager] removeItemAtPath:savePath error:NULL];
原文地址:https://www.cnblogs.com/gaoxiao228/p/2921059.html