我正试图从Camera Roll转到新的视图控制器。所以基本上我想能够选择一张图片,选择图片后,它会显示在新视图控制器上的imageView上?那很难吗?
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:
(NSDictionary *)info{
self.chosenImage = info[UIImagePickerControllerOriginalImage];
[self.imageView setImage:self.chosenImage];
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[self dismissViewControllerAnimated:YES completion:nil];
}
答案 0 :(得分:2)
在您的图像选择器委托方法中,每当您拍摄图像时,它都会采用以下方法
-(void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage : (UIImage *)image
editingInfo:(NSDictionary *)editingInfo
{
//store image here as NSData or as you like
// go to the view controller when you want to use image and use the image data
// do all the stuf you need in this method
}