在我的主视图控制器中,我有一个按钮,提示用户从他们的照片库中选择一张照片,然后显示它(img),如下所示:UIImagePicker在一个视图中,发送选定的图像到第二个视图
-(IBAction) getPhoto:(id) sender {
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:picker animated:YES];
[picker release];}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
img.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];}
我的问题是我怎样才能在第二个视图控制器中显示这个选定的图像?我知道如何去一个不同的观点,我只是不确定如何将图像发送到该视图。
感谢您的所有答案。这样做,工作很好。 –