我试图UIImageView
从一个segue设置一个,由于某种原因,图像没有被设置。这.h
是我的类的子类文件UIViewController
@interface PhotoDisplayViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIImageView *photoView;
-(void)setPhoto:(UIImage *)photo;
@end
这是setPhoto
-(void)setPhoto:(UIImage *)photo{
NSLog(@"PHOTO %@", photo);
_photoView.image = photo;
NSLog(@"MYPHOTO %@", _photoView.image);
}
当我从准备 segue 调用 setPhoto 时,我在控制台中看到了这个
2012-12-16 13:26:22.129 TestApp[2183:907] PHOTO <UIImage: 0x1fd7cd80>
2012-12-16 13:26:22.130 TestApp[2183:907] MYPHOTO (null)
为什么会这样?