Я 2 UIButton
с, я хочу обе кнопки, чтобы выбрать изображение, button1
устанавливает изображение в imageview1
и button2
к imageView2
. Теперь я создал button1
, который улавливает изображение и установите imageView1
к этому образу, но если я создаю button2
, я сейчас не то, что я должен делать в:2 UIButtons установить 2 UIImageViews
- (IBAction)chooseImage1:(id)sender {
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:imagePicker animated:YES completion:nil];
}
- (IBAction)chooseImage2:(id)sender {
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:imagePicker animated:YES completion:nil];
}
UIImage *image;
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSURL *mediaURL;
mediaURL = (NSURL *)[info valueForKey:UIImagePickerControllerMediaURL];
image = (UIImage *)[info valueForKey:UIImagePickerControllerOriginalImage];
imageView1.image=image;
[picker dismissViewControllerAnimated:YES completion:nil];
}
-(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[picker dismissViewControllerAnimated:YES completion:nil];
}
Nah, а не вопрос Xcode. – 2013-04-18 19:43:35