我目前在控制台中收到此崩溃日志:

时间:2011-12-01 10:15:23

标签: iphone objective-c ios

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

Current language:  auto; currently objective-c

守则

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

有谁知道这意味着什么?可能是什么原因?

谢谢!

1 个答案:

答案 0 :(得分:2)

问题应该在这里:

firstView.image = firstPhoto.photo;

什么是firstPhoto?什么时候发布?我想它会在成为UIImageView的内容之前被解除分配。

<德尔> 您可能需要发送一条“[retain]”消息,例如:     firstView.image = [firstPhoto.photo retain];