enumeratorAtPath - path string issue???
enumeratorAtPath - path string issue???
- Subject: enumeratorAtPath - path string issue???
- From: Rail Jon Rogut <email@hidden>
- Date: Thu, 5 Jun 2008 14:50:57 -0700
I'm a newbie to Cocoa, so be gentle...
I'm trying to find all the WAV files in a given folder, so I have a
function:
- (NSMutableArray *) getFileListArray:(NSString *)searchPath
{
NSMutableArray * resultArray;
NSString *file;
NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager]
enumeratorAtPath:searchPath];
NSLog(@"searchPath = %@", searchPath);
while (file = [dirEnum nextObject])
{
NSLog(@"Found file = %@", file);
if ([[[file pathExtension] lowercaseString] isEqualToString: @"wav"])
{
NSLog(@"WAV File = %@", file);
// Will add to resultArray
}
}
return resultArray;
}
but it doesn't like my searchPath value.. which looks fine to me....
(NSLog output): searchPath = /Volumes/JSD 750-1/BFD/Data/AFJ Kit 3/
Hihat1/Pedal
If I use the XCode docs example path:
NSString *docsDir = [NSHomeDirectory()
stringByAppendingPathComponent: @"Documents"];
(NSLog output): searchPath = /Users/railrogut/Documents
It works fine - so the problem is with my path...??? The actual path
does exist and has plenty of WAV files in it...
Any ideas of what I'm missing?
Thanks,
Rail
-------------------------------------------------
Rail Jon Rogut
www.platinumsamples.com
mailto: email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden