挑選圖片的時候我是比較新的X代碼 和 餘米工作的照片拼貼應用程序,當我拿起圖像從一個選擇器,然後圖像選擇器工作正常,但我想從不同的圖像挑選不同的圖像,然後圖像選擇器不能正常工作如何調用imagepickerdelegate方法兩次從dirrerent按鈕
任何人都可以幫助我解決我的問題。這裏是我的代碼
`
-(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;
}
`
請你的問題更清楚,所以,我們可以幫你 – TheTiger