• 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
Re: How to enumerate directory contents?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to enumerate directory contents?


  • Subject: Re: How to enumerate directory contents?
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 21 Aug 2008 12:49:58 -0400
  • Organization: Rogue Research

On 8/21/08 7:46 AM, Paul Archibald said:

>	NSString *file;
>	// Get all of the files in the source directory, loop thru them.
>	NSEnumerator *files = [[myFileMgr
>directoryContentsAtPath:srcDirectory] objectEnumerator];
>	while(file = [files nextObject] ) {
>		if( [[file pathExtension] isEqualToString:interestingExtension] ) {
>			// do something with file
>		}

You might want to read the docs for "isEqualToString".  Using it to
compare file extensions will not behave as the user expects (case
sensitivity, Unicode decomposition, etc.)

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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: How to enumerate directory contents?
      • From: Paul Archibald <email@hidden>
References: 
 >Re: How to enumerate directory contents? (From: Paul Archibald <email@hidden>)

  • Prev by Date: [Q] SFPreferenceView and authorize as admin?
  • Next by Date: Re: NSWindowController, owner, "primary window"...
  • Previous by thread: Re: How to enumerate directory contents?
  • Next by thread: Re: How to enumerate directory contents?
  • Index(es):
    • Date
    • Thread