Use @2x retina images for ipad in universal app? and does apple prefer native apps?

shannoga picture shannoga · Feb 23, 2011 · Viewed 20.1k times · Source

I know there were some discussions about this but i could not find good answer?

My questions are -

  1. I know that -

      [UIImage imageNamed:@"blabla"]
    

will automatically search for the correct image to display (retina or not) on iPhone.

I have a Universal app, and i wish to use the @2x versions on the ipad so i wont have to load an other version of the images (I have hundreds of small images).

is it possible ?

  • I saw in some places that people wrote that apple discourage Universal apps as it prefers building separated apps for iPhone and iPad ? is that correct even when i create a different UI for each?

thanks

shani

Answer

JohannaVL picture JohannaVL · Mar 9, 2012

If you're loading an image named "image" the search paths are likely to be the same as they've always been:

iPhone:

  • 1) image@2x~iphone.png (retina only)
  • 2) [email protected] (retina only)
  • 3) image~iphone.png
  • 4) image.png

iPad:

  • 1) image@2x~ipad.png (retina only)
  • 2) [email protected] (retina only)
  • 3) image~ipad.png
  • 4) image.png