Crash when opening possession detail view 2nd time


#1

Hello,

i have the 2nd edition to the book and use ARC.

The code for taking images and saving it in image store works fine for the first time.
When I open the possession detail view the second time the app crashes on iPad.
I do not know if it crashes on iPhone too.

I get the following exception

2012-01-14 17:14:16.165 UITableView[1431:707] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[__NSCFDictionary _isResizable]: unrecognized selector sent to instance 0x1a5870’

I debugged hundred of hours to find the problem, but failed.

The exception occurs when the viewWillAppear method will be left.

The last part the worked successful inside viewWill Appear
is
if (nil != key)
{
UIImage* image1 = [[ImageStore Instance] getImage:key];

//[self setImageView: [[UIImageView alloc] initWithImage:image1]];
[[self ImageView] setImage:image1];

}

The image is retrieved successful from imageStore
Than it is successfully assigned to the UIImageView, which is ImageView.

Than the debugger jumps to synthesize ImageView (with step into)
which is i guess the setter method.

The next ‘step into’ leads to the crash.

Does anybody have a hint for that?
Is that an iPad issue?
I have some bad feeling that the UIImageView gets destroyed somehow

Please help, because I do not know whats going on.

Please keep in mind, that i am using ARC.

Regards
Michael


#2

Hello,

sorry guys.
Sometimes one has to contact a forum to find the error in your code.

I have to variables.
image for the UIImage
and
images for the dictionary.

I trapped into code completion.
Instead of saving the image into the dictionary,
i saved the images into the dictionary.

So when retrieving the image, i got the images instead.
And setting an Dictionary into the UIImageView is not a good idea I guess.

This explains the exception.
The code was asking the dictionary if it is resizable, which is of course not
so bang!

Thank you
Michael