We hope you find the code below useful.
NSArray *dirContents = [[NSFileManager defaultManager] directoryContentsAtPath:documentDirectory]; for (NSString *tString in dirContents) { if ([tString hasPrefix:@"001"] && [tString hasSuffix:@".jpg"]) {
Here documentDirectory denotes the path to the document directory. If your files are located in a location other than the document directory, obviously you can put the path there.
source share