I cant get my Image(.png) to display.
I check that it exists at the path I use, and it does. But no image appears.
Here is what I've been trying:
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
NSString *outputPath = [documentsDir stringByAppendingPathComponent:[fileList objectAtIndex:indexPath.row]];
NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
NSString *imgPath = [[outputPath stringByReplacingOccurrencesOfString:@"mov" withString:@"png"]retain];
if ([fileManager fileExistsAtPath:imgPath])
{
NSLog(@"FOUND IMG");
NSLog(imgPath);
}
NSData *imgData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:imgPath]];
UIImage *thumbNail = [[UIImage alloc] initWithData:imgData];
UIImageView * imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 120, 120)];
[imgView setImage:thumbNail];
[cell addSubview:imgView];
[imgView release];
The debug output that confirms the file exists
FOUND IMG
2011-12-26 12:42:23.066 iGeo2[412:707] /var/mobile/Applications/1A2B0D85-CDB1-4E4B-
9509-EF68B1A0E720/Documents/0.009000.png
I'm a little baffled. Anybody see where I've made the mistake?
Many Thanks, -Code
I've tried a few other methods, but nothing ever appears.