How to find out all files or images in a folder?

Discussion in 'iOS Programming' started by privateson, Jun 28, 2009.

  1. privateson macrumors newbie

    Joined:
    Jun 28, 2009
    #1
    Hi,

    I am writing an iphone app now.
    Does anyone know how to find out all the images or files in my app's folder.
    In my app, I plan to show the users some of my images.
    I will have these photos inside a folder of my app.
    I want to know how to list them all.

    Thanks for your help
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Code:
    + (void)listFolderContents:(NSString*)inPath
    {
    	NSLog(@"list of %@", inPath);
    
    	NSDirectoryEnumerator*	e = [[NSFileManager defaultManager] enumeratorAtPath:inPath];
    	
    	for (NSString* file in e)
    	{
    		NSLog(file);
    	}
    }
    
     
  3. privateson thread starter macrumors newbie

    Joined:
    Jun 28, 2009
    #3
    let me try!!!

    Thanks man,

    I will try it asap!

    Thanks again
     

Share This Page