私はXコードに比較的慣れておらず、写真のコラージュアプリに取り組んでいます。あるピッカーから画像を選択すると、画像ピッカーは正しく機能しますが、別の画像ピッカーから別の画像を選択したいのですが、画像ピッカーが正しく機能しません。
誰かが私の問題を解決するのを手伝ってくれます。これが私のコードです
`
-(IBAction)imagepickMethod1:(id)sender
{
imagepicker=[[UIImagePickerController alloc]init];
imagepicker.delegate=self;
imagepicker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagepicker animated:YES];
button1.tag=100;
}
-(IBAction)imagepickMethod2:(id)sender
{
imagepicker1=[[UIImagePickerController alloc]init];
imagepicker1.delegate=self;
imagepicker1.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagepicker1 animated:YES];
}
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
[picker dismissModalViewControllerAnimated:YES];
imagepicker.view.hidden=YES;
photoPreviewImageView.image=image;
}
-(void)imagePickerController1:(UIImagePickerController *)picker1 didFinishPickingImage:(UIImage *)image1 editingInfo:(NSDictionary *)editingInfo1
{
[picker1 dismissModalViewControllerAnimated:YES];
imagepicker.view.hidden=YES;
photoPreviewImageView1.image=image1;
}
`