views:

35

answers:

1

Hi all,

I am having List of images in my project i have to get the entire list Using NSBundle, How can i do this

Thank You

A: 

This should do it:

 NSLog(@"Images in bundle are:");

 NSString *imageExtension = @"png";
 NSArray *pngPaths = [[NSBundle mainBundle] pathsForResourcesOfType:imageExtension inDirectory:nil];
 for (NSString *filePath in pngPaths)
 {
     NSString *fileName = [filename lastPathComponent];
     NSLog(@"%@", fileName);
 }

Obviously, just change the imageExtension string for the image type you want.

Brock Woolf
Thank You Brock..
kiri