我正在尝试将图像设置为 imageview 但它不起作用,我将所有连接设置为 Interface Builder。
当我运行程序时,调试器显示以下内容:
(lldb) po image
(UIImage *) $2 = 0x06ed2290 <UIImage: 0x6ed2290>
对于它说的imageview:
(lldb) po self.imageView
(UIImageView *) $1 = 0x06eac5e0 <UIImageView: 0x6eac5e0; frame = (0 0; 0 0); opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x6ead050>>
使用以下代码设置图像:
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
[self.imageView setImage:image];
[popoverController dismissPopoverAnimated:YES];
[picker dismissModalViewControllerAnimated:YES];
}
但图像不显示。