title: iPhone programming: How do I make a UIImage in a UIImageView show at actual size?
body: <p>I have a <code>UIImage</code> that I want to show pixel-for-pixel on an iPhone 4/4S/5 screen. It's important that it is not scaled at all, but when I try using <code>setImage</code>, it makes the image too large.</p>
  
  <p>My <code>UIImageView</code> is made in a <code>UIStoryboard</code> (since I'm really new to this) and is set to the mode "redraw" with everything else default. None of the other modes are scaling the <code>UIImage</code> properly (EDIT: that is, setting the <code>UIImageViews</code> contentMode to other things won't work).</p>
  
  <p>I looked around and found this:</p>
  
  <pre><code>[self.imageView setImage: image];
  self.imageView.frame = CGRectMake(self.imageView.frame.origin.x, 
                                    self.imageView.frame.origin.y,
                                    image.size.width, 
                                    image.size.height);
  </code></pre>
  
  <p>which doesn't work. I tried halving each dimension, and it's still off.</p>
  
  <p>UPDATE: I think that it is being scaled for the retina display after the fact because on both the retina iPhone 4 I am using and the non-retina simulator mode, the images use up the same percentage of the screen. Is there some way I can set the UIImage or UIImageView or project to be "retina-ready"?</p>
  
  <p>UPDATE 2: Making the image smaller by halving each dimension appears to work. The iPhone 4/4S has double the pixels of the 2G/3G/3GS. But this seems like a hack solution, and I'm not even sure if it's taking advantage of the retina display pixel density when I do that.</p>