Adding my comment as an answer,
You might have to create your own methods to fetch images based on device. You shouldn't be naming images with @2x in that case. Your method should fetch image based on device and retina display and give back the name of the image which can be used to create UIImage
objects. This method can be a category added on UIImage
.
For eg:-
[UIImage testImageNamed:@"test.png"];
and implement testImageNamed
method as a category in UIImage
which returns testRetina.png
or test.png
based on device and retina/non-retina resolution.
Update: Alternatively, you can also try with the following for iPod touch device in this category so that you can keep images with @2x itself(test.png and test@2x.png). I am not sure if this will work or not. I am assuming that in case fileName has only "test", this might fetch test.png itself but I haven't tried this. This is definitely worth a try.
NSString *fileLocation = [[NSBundle mainBundle] pathForResource:fileName ofType:extension];
NSData *imageData = [NSData dataWithContentsOfFile:fileLocation];
[UIImage imageWithData:imageData];
Add the above only for iPod touch and for other devices it can return normal [self imageNamed:@"test.png"];