Don't have the pictures from directory on CollectionView

回眸只為那壹抹淺笑 提交于 2019-12-02 09:29:25

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

    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!