Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone/iOS How to load a lot of image in many folder and show in a table view?
    text
    copied!<p>I got annoying question...</p> <p>What if I have many image , and I want load it in to a table view</p> <p>And show the file name as cell's text , and the preview image is also show in the cell.</p> <p>When I select the cell , it will push to next view , show the big size image.</p> <p>That's it .</p> <p>I don't know how to load many folder to an array?</p> <p>/*********** EDIT ***********/ This is the folder I set many images inside <img src="https://i.stack.imgur.com/LRsoC.png" alt="enter image description here"></p> <p>You can see that's only one root folder ...</p> <p>And this is my code to load the image inside</p> <pre><code>NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Image"ofType:@""]; NSDirectoryEnumerator *direnum; direnum = [fileManager enumeratorAtPath: filePath]; imageFolder = [NSMutableArray new]; for(NSString *filename in direnum){ if([[filename pathExtension] isEqualToString:@"png"]){ [imageFolder addObject:filename]; } } NSLog(@"Files in the folder %@",imageFolder); </code></pre> <p>I got result like this :</p> <pre><code> Files in the folder ( "macro1.png", "macro10.png", "macro11.png", "macro12.png", "macro13.png", "macro14.png", "macro15.png", "macro16.png", "macro17.png", "macro18.png", "macro19.png", "macro2.png", "macro20.png", "macro21.png", "macro22.png", "macro23.png", "macro24.png", "macro25.png", "macro26.png", "macro27.png", "macro4.png", "macro5.png", "macro6.png", "macro7.png", "macro8.png", "macro9.png" </code></pre> <p>)</p> <p>But what if I change the root folder like this <img src="https://i.stack.imgur.com/f7Fia.png" alt="enter image description here"></p> <p>How to read the image files in the subfolders?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload