你有没有从CameraRoll到一个新的视图控制器的方法?

我正试图从相机胶卷到一个新的视图控制器。 所以基本上我想能够select一个图片,select图片后,它会显示在一个新的视图控制器上的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]; } 

在你的图像select器委托方法中,每当你拍摄图像时,都会按照下面的方法进行

 -(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 }