title: How do NSBundle pathForResource:ofType: and UIImage imageWithContentsOfFile: handle scale and device modifiers?
body: <p>In my iOS resource folder, I have the images:</p>
  
  <pre><code>foo~iphone.png
  foo@2x~iphone.png
  foo~ipad.png
  foo@2x~ipad.png
  </code></pre>
  
  <p>I load them with:</p>
  
  <pre><code>NSString *fileName = [[NSBundle mainBundle] pathForResource:@"foo" ofType:@"png"];
  UIImage *image = [UIImage imageWithContentsOfFile:fileName];
  </code></pre>
  
  <p>Experimentally:</p>
  
  <p>On the iPhone, <code>filename</code> is <code>/path/to/bundle/foo~iphone.png</code>, and on the retina iPhone, it loads the <code>@2x</code> version.</p>
  
  <p>On the iPad, <code>filename</code> is <code>/path/to/bundle/foo~ipad.png</code>, and on the retina iPad, it loads the <code>@2x</code> version.</p>
  
  <p>That is, it loads the image I'd hope, but <code>pathForResource</code> handles the device modifier, and <code>imageWithContentsOfFile</code> handles the scale modifier.</p>
  
  <p>I'd like to know why. The <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/Reference/Reference.html" rel="noreferrer">documentation</a> of <code>pathForResource</code> says nothing about device modifiers, and the <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImage_Class/Reference/Reference.html" rel="noreferrer">documentation</a> of <code>imageWithContentsOfFile</code> says nothing about scale modifiers.</p>
  
  <p>Is there separate documentation that indicates precisely what each function does?</p>