我正在尝试使用相机拍照,然后将所选照片传递到另一个视图控制器。我使用 segue 将图像推送到下一个,但它似乎没有得到图像。
杂注标记 - UIImagePickerDelegate 方法
//delegate methode will be called after picking photo either from camera or library
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissViewControllerAnimated:YES completion:nil];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
[self.collectedImageView setImage:image];
[self performSegueWithIdentifier:@"photoArea" sender:self];
}
pragma mark - 为 Segue 做准备
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
MESSelectPhotoAreaViewController *photoAreaVC = [segue destinationViewController];
photoAreaVC.photoImageView.image = self.collectedImageView.image;
}