I downloaded an image, and I stored it on disk. After downloading the class inserts the image path in the core data, getting this string:
@"/Users/Tiago/Library/Developer/CoreSimulator/Devices/3E103B07-E48E-4740-911C-ECD24E0C3A3F/data/Containers/Data/Application/D17A1BA1-7096-49F9-BDAD-9587B2780715/Documents/54bf3ebf657f6f2c04a81b0b.jpg
"
However at the time of loading this image into a UIImage it is started with nil, as shown in the code below:
// Implementação de uma UITableView.
...
NSManagedObject *device = [dadosRetornadosDoCoreData objectAtIndex:indexPath.row];
...
NSString* stringPath = [device valueForKey:@"imagempath"];
UIImage* imageNew = [[UIImage alloc]initWithContentsOfFile:stringPath];
[cell.imagemProduto setImage:imageNew];
return cell;
I added an image to the project, and I loaded it as the code below:
UIImage* imageNew = [[UIImage imageNamed:@"cloud.png"];
And loaded normally.
Detail: The String leading to the image is coming from the Core Data store. I do not know if this can affect String interpretation.