i am checking if the directory exist but i get a warning
Incompatible integer to pointer conversion sending 'BOOL' (aka 'signed char') to parameter of type 'BOOL *' (aka 'signed char *')
BOOL isFile ;
isFile = [[NSFileManager defaultManager] fileExistsAtPath:[dirurl path] isDirectory:YES];
why do i get this warning and how to fix it
Use like this:
BOOL isDir;
BOOL isFileExists;
isFileExists = [[NSFileManager defaultManager] fileExistsAtPath:[dirurl path] isDirectory:&isDir];
if (isDir) {...}
Official documentation example developer.apple.com:
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];
// ...
[fileManager release];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With