title: Dispelling the UIImage imageNamed: FUD
body: <p>Edit Feb 2014: <strong>Note that this question dates from iOS 2.0!</strong> Image requirements and handling have moved on a lot since then. Retina makes images bigger and loading them slightly more complex. With the built in support for iPad and retina images, <strong>you should certainly use ImageNamed in your code</strong>.</p>
  
  <p>I see a lot of people saying <code>imageNamed</code> is bad but equal numbers of people saying the performance is good - especially when rendering <code>UITableView</code>s. See <a href="https://stackoverflow.com/questions/316236/uiimage-imagenamed-vs-uiimage-imagewithdata">this SO question</a> for example or <a href="http://iphonedevelopertips.com/memory-management/images-and-caching.html" rel="nofollow noreferrer">this article</a> on iPhoneDeveloperTips.com </p>
  
  <p><code>UIImage</code>'s <code>imageNamed</code> method used to leak so it was best avoided but has been fixed in recent releases. I'd like to understand the caching algorithm better in order to make a reasoned decision about where I can trust the system to cache my images and where I need to go the extra mile and do it myself. My current basic understanding is that it's a simple <code>NSMutableDictionary</code> of <code>UIImages</code> referenced by filename. It gets bigger and when memory runs out it gets a lot smaller.</p>
  
  <p>For example, does anyone know for sure that the image cache behind <code>imageNamed</code> does not respond to <code>didReceiveMemoryWarning</code>? It seems unlikely that Apple would not do this.</p>
  
  <p>If you have any insight into the caching algorithm, please post it here.</p>