Use this:
BOOL isDir; BOOL isFileExists; isFileExists = [[NSFileManager defaultManager] fileExistsAtPath:[dirurl path] isDirectory:&isDir]; if (isDir) {...}
Developer.apple.com official documentation sample:
NSArray *subpaths; BOOL isDir; NSArray *paths = NSSearchPathForDirectoriesInDomains (NSLibraryDirectory, NSUserDomainMask, YES); if ([paths count] == 1) { NSFileManager *fileManager = [[NSFileManager alloc] init]; NSString *fontPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"Fonts"]; if ([fileManager fileExistsAtPath:fontPath isDirectory:&isDir] && isDir) { subpaths = [fileManager subpathsAtPath:fontPath];
source share