pengfei
pengfei

Reputation: 1

I am currently getting this crash log in the console:

2011-12-01 18:10:36.932 AVCam[3987:17903] *** -[UIImage _isResizable]: message sent to deallocated instance 0xdf7e360

Current language:  auto; currently objective-c

The Code is

UIImageView * firstView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 240)];
[firstView setContentMode:UIViewContentModeScaleAspectFill];
firstView.image = firstPhoto.photo;
[firstBlock addSubview:firstView];
[firstView release];

Does anyone know what this means? What could be the cause of it?

Thanks!

Upvotes: 0

Views: 542

Answers (1)

Alessandro Vendruscolo
Alessandro Vendruscolo

Reputation: 14877

The problem should be here:

firstView.image = firstPhoto.photo;

What is firstPhoto? When does it get released? I guess it gets deallocated before it becomes the content of that UIImageView.

You'll probably have to send a `[retain]` message, something like: firstView.image = [firstPhoto.photo retain];

Upvotes: 2

Related Questions