如何从下面的按钮选择器代码中调用此方法:
- (void)displayEditorForImage:(UIImage *)imageToEdit
{
AFPhotoEditorController *editorController = [[AFPhotoEditorController alloc] initWithImage:imageToEdit];
[editorController setDelegate:self];
[self presentViewController:editorController animated:YES completion:nil];
}
这是我试图调用该方法的 UIButton:
//edit button
UIButton *editButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[editButton addTarget:self
action:@selector(editBtnTouch)
forControlEvents:UIControlEventTouchDown];
[editButton setTitle:@"Effects" forState:UIControlStateNormal];
**// the following line shows the selector where I'm unsure how to call the method from the code above**
if ([[UIScreen mainScreen] respondsToSelector:@selector(displayEditorForImage:)] &&
([UIScreen mainScreen].scale == 2.0)) {
// Retina display
editButton.frame = CGRectMake(220.0, 320.0, 60.0, 40.0);
} else {
editButton.frame = CGRectMake(220.0, 315.0, 60.0, 40.0);
}
[self.view addSubview:editButton];
谢谢您的帮助