Image disappears after leaving the DetailViewController


#1

HI I have a problem which i just can’t see the error for.

I can take a pic with the camera leave the picture view and come back in to the detail view, the image is there! if i go back to the items view and select the item again when i come back into the detail view the image is no longer there!
I’ve put a break point in at:

NSString *imageKey = [item imageKey]; if (imageKey) { //get image for imagekey from imagestore UIImage *imageToDisplay = [[BNRImageStore sharedStore] imageForKey]; //use that image to put the image on screen [imageView setImage:imageToDisplay]; } else { //clear the image view [imageView setImage:nil]; }
in viewWillAppear, and it steps through fine after you’ve taken the picture and when the record has no picture! it’s when i come back in after been in the item view and you set the imageToDisplay it seem not to be able to find the key!

Can anyone help?

thanks, David :slight_smile:


#2

problem fixed, found that the images weren’t been saved to the Dictionary, found that I’d missed the ‘!’ mark from the sharedStore method if statement.