Don't have the pictures from directory on CollectionView

后端 未结 1 1689
一整个雨季
一整个雨季 2021-01-26 16:34

I would want to show all the pictures in my directory however I am creating Folders in the Directory so that I can sort the pictures. I want to show all of the pictures in seve

相关标签:
1条回答
  • 2021-01-26 16:39

    If you have multiple folders then you need to iterate over the folders and then the folder contents to process all of it.

    While this line:

    NSString *location=@"Bottoms"@"Top"@"Right"@"Left"@"Down"@"Up";
    

    Is technically legal, I guess you're thinking it will do some array / iteration thing for you. It won't. It just concatenates all of the strings together. You probably want something more like:

    NSArray *locations = @[ @"Bottoms", @"Top", @"Right", @"Left", @"Down", @"Up" ];
    

    Then you can run a loop over the folders and then the contents:

    for(NSString *folder in locations) {
    
        // get the folder contents 
    
        for(NSString *file in directoryContent) {
    
            // load the image
    
        }
    }
    
    0 讨论(0)
提交回复
热议问题