• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
enumeratorAtPath - path string issue???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: enumeratorAtPath - path string issue???
      • From: "Kyle Sluder" <email@hidden>
    • Re: enumeratorAtPath - path string issue???
      • From: Andy Lee <email@hidden>
  • Prev by Date: Re: NSTextView causes lockups when appending too quickly and/or scrolling
  • Next by Date: Re: detect URL change
  • Previous by thread: Re: [Newbie] Proper class releasing
  • Next by thread: Re: enumeratorAtPath - path string issue???
  • Index(es):
    • Date
    • Thread