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 PROTECTED]
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]