换句话说:我有一个带有两个事件的按钮,如何捕获UIControlEventTouchDown
并UIControlEventTouchUpInside
在回调函数中setRedPos
?
[btnRedPos addTarget:self action:@selector(setRedPos:) forControlEvents:UIControlEventTouchDown];// I want to pass in a value of 0
[btnRedPos addTarget:self action:@selector(setRedPos:) forControlEvents:UIControlEventTouchUpInside];// I want to pass in a value of 1
...
- (void) setRedPos:(UIButton*)btn
{
}