title: iOS UIImage not displaying JPEG images
body: <p>I'm having trouble displaying some of the images in my iOS app. I have changed some of the graphics from PNG to JPG file format and when I removed the PNG images already in the project and added the new JPGs, the simulator was still showing old PNG graphics. I ran 'clean' on the project and reset simulator's contents, and now it just does not want to load the images at all - <code>[UIImage imageNamed:@"filename"]</code> returns null.</p>
  
  <p>On the other hand, if I save those graphics as PNG, and add them to the project <em>instead</em> of JPEGs, it loads them fine. But the images are photographic and PNG versions are 7-8 times larger than JPEG, so I'd really want to figure out why it won't load them.</p>
  
  <p>Edit: after reviewing the documentation (for what seems like 100th time), I realized that the mistake was that I did not specify the extension. The Supported Image Formats (<a href="http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIImage_Class/Reference/Reference.html" rel="nofollow">http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIImage_Class/Reference/Reference.html</a>) lists quite a few formats that are supported, and UIImage reference says that:</p>
  
  <blockquote>
    <p>On iOS 4 and later, if the file is in PNG format, it is not necessary to specify the .PNG filename extension.</p>
  </blockquote>
  
  <p>I misread that to mean that the extension is optional in general, but if the file is not a PNG, you have to include it. So if the file is called my_image.png, then you can pass it as @"my_image" or @"my_image.png", but if you have my_image.jpg, it will only work as @"my_image.jpg".</p>