I have develop one universal app. I have four type images
- iphone – simple.png
- iphone retina – simple@2x.png
- ipad – simple@3x.png
- ipad retina – simple@3x@2x.png
When i try to run the application, it works fine into ipad (non retina) but it gives black screen (no images) into ipad retina.
Here, put code of function which give me related name for iphone & ipad.
#define SHImageString(str, ext) ({ UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ? ([NSString stringWithFormat:@"%@.%@", (str), (ext)]) : ([NSString stringWithFormat:@"%@@3x.%@", (str), (ext)]); })
Thanks in advance.
It should be like this:
In your code (or XIB) you only use the files without the
@2x. If the app is run on a retina display it will automatically use the@2xversion. I’ve used this many many time, works perfect.