【发布时间】:2013-07-16 20:14:56
【问题描述】:
如何从下面的按钮选择器代码中调用此方法:
- (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];
感谢您的帮助
【问题讨论】:
标签: iphone ios objective-c methods