Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

privateson

macrumors newbie
Original poster
Jun 28, 2009
5
0
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
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Code:
+ (void)listFolderContents:(NSString*)inPath
{
	NSLog(@"list of %@", inPath);

	NSDirectoryEnumerator*	e = [[NSFileManager defaultManager] enumeratorAtPath:inPath];
	
	for (NSString* file in e)
	{
		NSLog(file);
	}
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.