I’m trying to figure out how to check if a folder exist within the project. The problem is that it can’t find “MyFolder” and I think that it is because it is not looking inside the bundle but rather on the root of the phone. If I print current path it returns “/”
BOOL isDir;
BOOL exists = [fileManager fileExistsAtPath:@"MyFolder/" isDirectory:&isDir];
if (exists) {
NSLog(@"exist");
/* file exists */
if (isDir) {
/* file is a directory */
NSLog(@"is dir");
}
}
How could I solve this?
If you are doing
Then your code is right and the error is in other piece of your code.
The “/” returned is the root of your app, you can not look at the root of the phone
Or you do not have the “MyFolder” folder.