I am working on some file manipulation in iPhone project. Where i need to search files of specific extension. One option is to manually process each file & directory to
Yes we have direct method for NSArray below helps you
NSMutableArray *arrayFiles = [[NSMutableArray alloc] initWithObjects:@"a.png", @"a.jpg", @"a.pdf", @"h.png", @"f.png", nil];
NSLog(@"pathsMatchingExtensions----%@",[arrayFiles pathsMatchingExtensions:[NSArray arrayWithObjects:@"png", nil]]);
//my output is
"a.png",
"h.png",
"f.png"