HI,
I am loading images from sub directory of document directory. Here is the code.
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
cell.imageView.image = [UIImage imageWithContentsOfFile:[documentsDir stringByAppendingPathComponent:[NSString stringWithFormat:@"images/category/%@", element.image]]];
My images resides at DocumentDir/images/category/img1.png, DocumentDir/images/category/img2.png, DocumentDir/images/category/img3.png …..
However when images are at DocumentDir it loads fine. But when it is in sub directories like above it does not load. Am I doing wrong here?
Thank you
Solved the issue. There was a new line character at the end of the “element.image” variable.