objective c - How to get all images in the project folder that start with a specific string -


i quite new in ios development , objective-c , appreciate help.

i created group folder in xcode placed images. images inside project folder.

i want iterate through xcode folder routineicons , images have b- in name , put name , extension array.

could point me in right direction on how this? bah.. possible??

enter image description here

you can use snipped:

 nsmutablearray *result = [nsmutablearray array];  [[[nsbundle mainbundle] pathsforresourcesoftype:@"png" indirectory:nil] enumerateobjectsusingblock:^(nsstring *obj, nsuinteger idx, bool *stop) {     nsstring *path = [obj lastpathcomponent];     if ([path hasprefix:@"b-"]) {         [result addobject:path];     } }]; 

Comments