0
我想弄清楚如何检查项目中是否存在文件夹。问题是,它找不到“MyFolder”,我认为这是因为它不是在捆绑内查看,而是在手机的根目录。如果我打印当前路径,则返回“/”检查包/项目中是否存在文件/文件夹
BOOL isDir;
BOOL exists = [fileManager fileExistsAtPath:@"MyFolder/" isDirectory:&isDir];
if (exists) {
NSLog(@"exist");
/* file exists */
if (isDir) {
/* file is a directory */
NSLog(@"is dir");
}
}
我该如何解决这个问题?