I didnt get any images displayed, only the filename is shown.
Currently im using this codes:
NSString *filePath = [[self documentsPath] stringByAppendingPathComponent:@""];
NSFileManager *imagesFileManager = [NSFileManager defaultManager];
imagesArr = [[imagesFileManager contentsOfDirectoryAtPath:filePath error:nil]filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.jpg'"]];
arryList = [[NSMutableArray alloc] initWithArray:[imagesArr copy]];//display text
imagesList = [[NSMutableArray alloc]init];//display image
for (NSString *anImage in arryList) {
anImage = [NSString stringWithFormat:@"Documents/%@",anImage];
[imagesList addObject:anImage];
}
In the
forloop , you are just adding the file path to the array instead of UIImage.Change the for loop as follows: