こんにちは、私はここが初めてで、Xcode の初心者でもあります。助けてください。Imagepickercontroller を作成しようとしていますが、1 つのエラーで問題が発生し、解決方法がわかりません。
Viewcontroller.h
@interface ViewController : UIViewController<UIImagePickerControllerDelegate> {
IBOutlet UIButton *button;
IBOutlet UIImageView *image;
UIImagePickerController *imagepicker;
}
- (IBAction)change:(id)sender;
@end
Viewcontroller.m
@interface ViewController ()
@end
@implementation ViewController
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *mytouch = [[event allTouches] anyObject];
button.center = [mytouch locationInView:self.view];
}
- (void)viewDidLoad
{
[super viewDidLoad];
imagepicker = [[UIImagePickerController alloc] init];
[imagepicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[imagepicker setAllowsEditing:YES];
}
- (IBAction)change:(id)sender
{
[self presentViewController:imagepicker animated:YES completion:NO];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[UIImage(setimage:)image];
[self dismissViewControllerAnimated:YES completion:NO];
}
@end
予想される識別子[UIImage(setimage:)image];