I build my project using iOS 7.1 and try to load UIImage view with image that is stored in the /images/cars/car_1.png
All images are located in the folder images as on picture below in project tree:
So it works perfect for iOS 7.1 and Xcode 5, but when I try to use Xcode 6 and iOS 8 the UIImage instance is equal nil when I try crate image.
UIImage *image = [UIImage imageNamed:@"/images/cars/car_1.png"];
po image
nil (for iOS 8)
it can be also
UIImage *image = [UIImage imageNamed:@"/images/sport-cars/car_1.png"];
as you can see the name of resources is the same car_1.png but it is ok because they are in different resources folders not in the bundle folders.
Ok the problem is that on the simulator and seems on the device as well by some reason when we use
@"/Reference Folder Path/image.jpg"
it won't work.Removing this "/" at start of path solve this issue.
You can check this video to see how it works.
So the answer is you have to specify the filename extension for all JPEG.
If this not solve your problem, Try this
Instead of using the imageNamed you can load the image with the methods imageWithContentsOfFile
I have added 3 folders (with same image name and extension) in my project. I am able to fetch them differently and it work fine