I save my images in the folder “pic” (an example of a full path for an image: /Users/apple/Library/Application Support/iPhone Simulator/5.1/Applications/2526EA68-229D-40BC-BB57-56E46EB55691/Documents/pic/1.jpg).
The “Document” path is got by calling:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
So the path is definitely correct . But when I do:
[tempImage setImage:[UIImage imageNamed:fullImagePath]]
It seems that the image is not found, because the image is not shown. I want to know the reason for this problem and how to fix it?
imageNamedonly works for images in the main bundle, not in subdirectories.Use
instead.