Если вы хотите сделать это, вам нужно будет использовать NSFileManager
, чтобы просмотреть содержимое [[NSBundle mainBundle] bundlePath]
(путь вашего комплекта приложений), чтобы найти все файлы с правильным расширением.
Лучший вопрос: почему вы хотите это сделать?
Редактировать: хорошо, если вы настаиваете, вам придется сделать что-то вроде этого:
NSEnumerator *iter = [[NSFileManager defaultManager] directoryEnumeratorAtPath:[[NSBundle mainBundle] bundlePath]];
int count = 0; // number of images
for (NSString *path in iter) { // iterate through all files in the bundle
if ([[path pathExtension] isEqualToString:@"png"]) { // test if the extension is "png"
count++; // increment the number of images
UIImage *img = [UIImage imageWithContentsOfFile:path];
// do other things with the image
}
}