I have no idea where this code is wrong. Please help, it is supposed to read a value from a dictionary and I use the value to call an image. I’ve tried to read the value as label.text but I got no result.
The only one I can call is from the nslog.
for (id key1 in dictionary)
{
NSMutableString *textnamed = [dictionary objectForKey:key1];
NSMutableString *imageDisplay =[NSMutableString stringWithFormat:@"%@.png",[dictionary objectForKey:key1]];
eyeImageSaved.image = [UIImage imageNamed:imageDisplay];
labelSaved.text = textnamed;
NSLog(@"%@",textnamed);
}
I solved my problem. There is nothing wrong with my code above, the mistake I made is that the object that is supposed to hold my variable and store in
plistas the name of the image became null. So I added the object toappdelegate.has seen below:AppDelegate
View Controller