IPhone: NSFilemanager fileExistsAtPath:isDirectory: not working properly?

This is a really easy mistake to make, but it's also really easy to fix. Enumerating the contents of a directory only gives you the name of the item, not the item's full path. You have to build the full path yourself.So where you have: for (NSString *aPath in contentOfFolder) { NSLog(@"apath: %@", aPath); BOOL isDir; if (NSFileManager defaultManager fileExistsAtPath:aPath isDirectory:&isDir &&isDir) { directoriesOfFolder addObject:aPath; NSLog(@"directoriesOfFolder %@", directoriesOfFolder); } } You should actually have this: for (NSString *aPath in contentOfFolder) { NSString * fullPath = path stringByAppendingPathComponent:aPath; BOOL isDir; if (NSFileManager defaultManager fileExistsAtPath:fullPath isDirectory:&isDir &&isDir) { directoriesOfFolder addObject: fullPath; } }.

– Yar Mar 6 at 18:01 @Yar: I usually put one in, but I fat fingered this one and left it out. However, I don't believe that it's syntactically required. – Dave DeLong Mar 6 at 18:05 Understood, just checking that I'm not missing something.

Thank you. – Yar Mar 6 at 19:10.

Get fileSize of info. IPhone, C/objC: getting hostname (not by resolving from IP) by hooking into system wide functions? IPhone - tabbed browsing by storing webView in an Array/plist?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions