How to load images from the Documents folder that have been saved dynamically?
<p>I have problem with loading images from the Documents folder of iPhone application into the tableView.</p>

<p>In a separate request, I check on the server all the images available and download them into the "images" folder under Documents. I am pretty sure that the images are saved correctly.</p>

<pre><code>NSString *filePath = [imagesFolderPath stringByAppendingPathComponent:imageFileName];
    [urlData writeToFile:filePath atomically:NO];
NSLog(@"Saved to file: %@", filePath);

2010-01-22 17:07:27.307 Foo[2102:207] Saved to file: /Users/Hoang/Library/Application Support/iPhone Simulator/User/Applications/6133A161-F9DC-4C92-8AE6-5651022EAA94/Documents/images/86_2.png
</code></pre>

<p>[NSBundle mainBundle] is not suitable for loading the images because at runtime, the application tries to connect to the server to download the images, they are not static.</p>

<p>But loading the images from Documents/images folder does not give me the image on the TableView. </p>

<pre><code>static NSString *CellIdentifier = @"CellCategory";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

// Set up the cell...
UIImageView *imageView = cell.imageView;

MenuItem *item = (MenuItem *) [arrayMenuItems objectAtIndex:indexPath.row];
cell.textLabel.text = item.descrizione;


NSString *strImagePath = [[imagesFolderPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%d_%d", item.idItem, item.idNode]] stringByAppendingPathExtension:@"png"];  
NSLog(@"strImagePath: %@", strImagePath);
imageView.image = [[UIImage imageWithContentsOfFile:strImagePath] autorelease];



2010-01-22 17:07:42.842 Foo[2102:207] strImagePath: /Users/Hoang/Library/Application Support/iPhone Simulator/User/Applications/6133A161-F9DC-4C92-8AE6-5651022EAA94/Documents/images/86_2.png
</code></pre>

<p>Is there anyone having the same problem?</p>

<p>I have looked around in stackoverflow but have not succeeded.</p>

<p>Thanks in advance.</p>
