我正在尝试从图库中获取图像,然后将其显示在 UIImageView 中。我的问题是显示此图像。我的代码:
- (void)getMediaFromSource:(UIImagePickerControllerSourceType)sourceType {
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.popController = [[UIPopoverController alloc] initWithContentViewController:imagePickerController];
self.popController.delegate = self;
[self.popController presentPopoverFromRect:[fromGalaryButton frame] inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[self.popController dismissPopoverAnimated:YES];
self.image = [info objectForKey:UIImagePickerControllerEditedImage];
[self updateDisplay];
}
-(void)updateDisplay {
self.imageView.image = self.image;
self.imageView.hidden = NO;
[self.imageView reloadInputViews];
}
我self.imageView
的显示正常。但是里面没有任何图像。有我的问题吗?