我正在尝试制作具有 2 个视图的 iOS 应用程序。第一个视图包含两个按钮:相机和库。当我选择图书馆时,我访问相机胶卷。我想选择一张照片并在另一个视图中打开它。直到现在我写这个函数
-(IBAction) getPhoto:(id) sender {
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if((UIButton *) sender == choosePhotoBtn) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
}
[self presentViewController:picker animated:YES completion:nil];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissViewControllerAnimated:YES completion: Nil];
imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
}
女巫在同一视图中打开我的图像。如何在另一个视图中打开此图像?