title: How do I enumerate and load resources in an iPhone app?
body: <p>I'm trying to populate an NSArray with a collection of images in Resources.  However, for maximum flexibility, I'm trying to avoid hard-coding the filenames or even how many files there are.</p>
  
  <p>Normally, I'd do something like this example from the sample code at apple:</p>
  
  <pre><code>kNumImages = 5;  //or whatever
  NSMutableArray *images;
  for (i = 1; i &lt;= kNumImages; i++)
  {
      NSString *imageName = [NSString stringWithFormat:@"image%d.jpg", i];
      [images addObject:[UIImage imageNamed:imageName];
  }
  </code></pre>
  
  <p>However, I'm trying to avoid kNumImages entirely.  Is there a way to run a regex or something on resources?</p>