title: EXC_BAD_ACCESS when returning UIImage
body: <p>I have a method which should return a UIImage created from contentsOfFile (to avoid caching), but when it returns, i receive EXC_BAD_ACCESS. Running through Instruments doesn't reveal any results, as it just runs, without stopping on a zombie. </p>
  
  <p>The image is correctly copied in the Bundle Resources phase...</p>
  
  <pre><code>- (UIImage *)imageForName:(NSString *)name {
      NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"png"];
      return [UIImage imageWithContentsOfFile:path];
  </code></pre>
  
  <p>}</p>
  
  <p>This method was adapted from the PhotoScroller sample, which works correctly.</p>
  
  <p>Thanks</p>
  
  <p>EDIT:</p>
  
  <p>This is the code that uses imageForName, and you can see i added the retain, as per Luke/T's suggestion, but the EXC_BAD_ACCESS is on the return, not my addObject: call:</p>
  
  <pre><code>NSMutableArray *images;
  
  for (NSDictionary *dict in imageListForPage){
      [images addObject:[[self imageForName:[dict valueForKey:@"name"]]retain]];
  }
  </code></pre>